conftest.py
raw| 1 | def pytest_collection_modifyitems(session, config, items): |
| 2 | # Avoid executing tests when executing `--flake8` flag (pytest-flake8) |
| 3 | try: |
| 4 | from pytest_flake8 import Flake8Item |
| 5 | |
| 6 | if config.getoption("--flake8"): |
| 7 | items[:] = [item for item in items if isinstance(item, Flake8Item)] |
| 8 | except ImportError: |
| 9 | pass |