conftest.py 340 B

123456789
  1. import sys
  2. from importlib.util import find_spec
  3. def pytest_addoption(parser, pluginmanager):
  4. # Ignore the "--mypy" argument if pytest-mypy is not installed and
  5. # the implementation is not cpython
  6. if sys.implementation.name != 'cpython' and not find_spec("pytest_mypy"):
  7. parser.addoption("--mypy", action="store_true")