From 0077f63bedb9b3574363b846a210b15e78ac7fb9 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 20 Aug 2024 11:21:37 +0200 Subject: [PATCH] explicit sys.path in tests not all import modes add test dir to sys.path --- pyproject.toml | 2 +- pytest.ini | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f74286b4c..dca3e932d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -145,7 +145,7 @@ search = '__version__: str = "{current_version}"' [tool.cibuildwheel] build-verbosity = "1" free-threaded-support = true -test-requires = ["pytest", "importlib_metadata"] +test-requires = ["pytest>=6", "importlib_metadata"] test-command = "pytest -vsx {package}/tools/test_wheel.py" [tool.cibuildwheel.linux] diff --git a/pytest.ini b/pytest.ini index ce7fc0793..90fc8a297 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,9 +1,11 @@ [pytest] -addopts = --durations 10 +addopts = --durations 10 --import-mode=importlib markers = large: these tests use a lot of memory new_console: these tests create a new console wheel: these tests are for installs from a wheel, not dev-installs +# import-mode=importlib doesn't put testpaths on sys.path +pythonpath = tests testpaths = tests # automatically run coroutine tests with asyncio