python-trio/pytest-trio

Tests fail with pytest 5.1.0 no attribute `RemovedInPytest4Warning`

costrouc opened this issue · 6 comments

The attribute pytest.RemovedInPytest4Warning was removed in pytest version 5.1.0 https://github.com/pytest-dev/pytest/blob/eeebcd77dd8d267c4577314f9f799b1502b4f71c/doc/en/changelog.rst#removals. This causes the tests suite to fail to run.

/nix/store/rzmw5viv9h6bxd8jxn5syqiys75blyzz-python3.7-pytest-5.3.5/lib/python3.7/site-packages/_pytest/config/__init__.py:459: in _importconftest
    return self._conftestpath2mod[key]
E   KeyError: PosixPath('/build/pytest-trio-0.5.2/pytest_trio/_tests/conftest.py')

During handling of the above exception, another exception occurred:
/nix/store/rzmw5viv9h6bxd8jxn5syqiys75blyzz-python3.7-pytest-5.3.5/lib/python3.7/site-packages/_pytest/config/__init__.py:465: in _importconftest
    mod = conftestpath.pyimport()
/nix/store/lag5klf38vsq4vsk5ja1599iyh7ixki5-python3.7-py-1.8.1/lib/python3.7/site-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
<frozen importlib._bootstrap>:983: in _find_and_load
    ???
<frozen importlib._bootstrap>:967: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:677: in _load_unlocked
    ???
/nix/store/rzmw5viv9h6bxd8jxn5syqiys75blyzz-python3.7-pytest-5.3.5/lib/python3.7/site-packages/_pytest/assertion/rewrite.py:143: in exec_module
    exec(co, module.__dict__)
/nix/store/f8kxygg4vq85scgkmsjbxsyya19f99g6-python3.7-pytest-trio-0.5.2/lib/python3.7/site-packages/pytest_trio/_tests/conftest.py:7: in <module>
    category=pytest.RemovedInPytest4Warning,
E   AttributeError: module 'pytest' has no attribute 'RemovedInPytest4Warning'

@costrouc Sorry the for the inconvenience! According to pytest-dev/pytest#4039 and pytest-dev/pytest#4045, I think we can now remove this code altogether in _tests/conftest.py because we appears to use --pyargs, whatever --pyargs is :)

Would you be interested in opening a pull request that does just that?

@pquentin sure! I opened the issue mentioned above. Hope it is along the lines of what you were looking for

@Alessandro-Barbieri can you please try again with 0.6.0?

@pquentin now I get another type of errors

@Alessandro-Barbieri sorry to hear that. Can you please open a new issue?