Skip to content

Commit

Permalink
Skip mypy test on platforms using importlib_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Apr 9, 2021
1 parent c0801b8 commit 8bcffa9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sros2/test/test_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@
@pytest.mark.mypy
@pytest.mark.linter
def test_mypy():
try:
import importlib.resources as _
except ModuleNotFoundError:
# The importlib_resources package is a backport of the importlib.resources module
# from Python 3.9. The 'policy' module of this project first tries to import from
# importlib.resources, then falls back to the backport package.
# There is a bug in mypy that manifests when this try/except import pattern is
# used: https://github.com/python/mypy/issues/1153
pytest.skip('This platform does not support mypy checking of importlib properly')
assert main(argv=[]) == 0, 'Found errors'

0 comments on commit 8bcffa9

Please sign in to comment.