pytest-qgis
Compatibility Issue with pytest>=8.0.0
- AssertionError in pytest_addoption
#68
Labels
bug
Something isn't working
Hey! I came across your project while testing the https://github.com/gee-community/qgis-earthengine-plugin. It's really helpful, and I got things working with
pytest==7.4.3
. I wanted to raise the error I got withpytest>=8
.Description:
When using
pytest-qgis 2.1.0
withpytest 8.x.x
, running tests results in the following error:Traceback (most recent call last): File "/path-to-site-packages/pytest_qgis/pytest_qgis.py", line 120, in pytest_addoption parser.addini( File "/path-to-site-packages/_pytest/config/argparsing.py", line 178, in addini assert type in (None, "pathlist", "args", "linelist", "bool") AssertionError
The error occurs because
pytest-qgis
is attempting to register an unsupportedtype
when using theparser.addini()
method. This appears to be incompatible with stricter validation rules introduced inpytest>=8.0.0
.Expected Behavior:
pytest-qgis
should register options with valid types supported bypytest>=8.0.0
without throwing anAssertionError
.Potential Fix?
Update the
pytest-qgis
source code to define theparser.addini()
types as valid values (e.g.,"args"
,"linelist"
). Example:This change would ensure compatibility with
pytest>=8.0.0
.Environment Details:
The text was updated successfully, but these errors were encountered: