| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
import os.path |
| 4 |
|
| 5 |
pytest_plugins = ["mypy.test.data"] |
| 6 |
|
| 7 |
|
| 8 |
def pytest_configure(config): |
| 9 |
mypy_source_root = os.path.dirname(os.path.abspath(__file__)) |
| 10 |
if os.getcwd() != mypy_source_root: |
| 11 |
os.chdir(mypy_source_root) |
| 12 |
|
| 13 |
|
| 14 |
# This function name is special to pytest. See |
| 15 |
# https://doc.pytest.org/en/latest/how-to/writing_plugins.html#initialization-command-line-and-configuration-hooks |
| 16 |
def pytest_addoption(parser) -> None: |
| 17 |
parser.addoption( |
| 18 |
"--bench", action="store_true", default=False, help="Enable the benchmark test runs" |
| 19 |
) |