pytest does not respect ini values defined in conftest.py as validly defined
See original GitHub issueCurrently, any ini options added via pytest_addoption
are flagged as unknown. They should be registered.
conftest.py:
gnikonorov:gleb_test [master] $ cat conftest.py
def pytest_addoption(parser):
parser.addini("my_ini", "")
gnikonorov:gleb_test [master] $
pytest.ini:
gnikonorov:gleb_test [master] $ cat pytest.ini
[pytest]
my_ini=1
minversion = 3.0.0
gnikonorov:gleb_test [master] $
gnikonorov:gleb_test [master] $ pytest
WARNING: Unknown config ini key: my_ini
...
gnikonorov:gleb_test [master] $
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Can conftest.py _read_ an existing value from pytest.ini?
I would like to look at the value of a parameter in pytest.ini and use it to set the default value of another...
Read more >API Reference — pytest documentation
This problem is commonly encountered when writing tests, e.g. when making sure that floating-point values are what you expect them to be.
Read more >pytest Documentation - Read the Docs
The first test passed and the second failed. You can easily see the intermediate values in the assertion to help you under-.
Read more >[WIP] How to create a modern pytest dev environment with ...
pycodestyleEnabled : enables the code style features. It shows alerts when you have something that does not respect the defined code style.
Read more >10 Cool Pytest Tips You Might Not Know About - PyBites
Here are 10 things we learned writing pytest code that might come in ... Hint: make sure your test modules/packages have valid Python...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@vitvakatu When you go to a PR (#7384) and click the commit ID at the bottom (“nicoddemus merged commit 4cc4ebf into pytest-dev:master”), you can see which version that commit is in:
So this has been in 6.0.0 already, and I can’t reproduce the issue with the reproducer in the original post. If you’re still running into problems, please open a separate issue.
No worries @vitvakatu!
Looks like @The-Compiler beat me to the answer. If you’re experiencing an issue it’s probably best to open a new issue like he mentioned.