Skip to content

Commit

Permalink
dev: Avoid pytest 7.0.0 on Python 3.9
Browse files Browse the repository at this point in the history
It contains a fatal bug¹ when used on 3.9 because it incorrectly guards
a 3.10-only implementation detail with a >=3.9 version check, which
results in:

    ModuleNotFoundError: No module named 'importlib.readers'

when trying to load/parse Python modules.

Pytest 7.0.0 is only ~11 hours old at the moment, and another person
filed the upstream bug report as I was writing my own.  What a life,
living on the edge. 😬

Adjusts the warnings filter slightly in pytest.ini because
PytestRemovedIn8Warning is only present in pytest 7 and for now our
tests on 3.9 will use pytest 6.

¹ pytest-dev/pytest#9608
  • Loading branch information
tsibley committed Feb 4, 2022
1 parent f8d9bd9 commit e0d8111
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pytest.ini
Expand Up @@ -14,4 +14,4 @@ filterwarnings =
error
ignore:SelectableGroups dict interface:DeprecationWarning:flake8
ignore:<class 'pytest_flake8[.]Flake8Item'> is not using a cooperative constructor:pytest.PytestDeprecationWarning
ignore:The .+? argument to Flake8Item is deprecated:pytest.PytestRemovedIn8Warning
ignore:The .+? argument to Flake8Item is deprecated:pytest.PytestDeprecationWarning
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -122,7 +122,8 @@ def find_namespaced_packages(namespace):
"flake8",
"mypy",
"nextstrain-sphinx-theme",
"pytest",
"pytest; python_version != '3.9'",
"pytest !=7.0.0; python_version == '3.9'",
"pytest-flake8",
"recommonmark",
"sphinx>=3",
Expand Down

0 comments on commit e0d8111

Please sign in to comment.