pytest does not respect ini values defined in conftest.py as validly defined

Created on 18 Jun 2020  路  5Comments  路  Source: pytest-dev/pytest

Currently, 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] $
bug

Most helpful comment

@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:

image

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.

All 5 comments

It's an easy fix, I placed the validation check in the wrong place. I'll have a PR up today

Hello, @gnikonorov

I'm sorry for bothering you, but when the fix for this problem will land in released version on PyPI? I currently use version 6.1.1, but the issue is still there.

@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:

image

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.

Thank you! Looks like it was my mistake, can't reproduce after some refactoring

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jurisbu picture jurisbu  路  3Comments

bluenote10 picture bluenote10  路  3Comments

tomalkalak picture tomalkalak  路  3Comments

RonnyPfannschmidt picture RonnyPfannschmidt  路  3Comments

SwampFalc picture SwampFalc  路  3Comments