diff --git a/pyproject.toml b/pyproject.toml index 08e11c1f..8945f9d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,7 @@ minversion = "7.0" addopts = """ --strict-config --strict-markers +--import-mode=importlib -ra -v -m 'not externalfile' diff --git a/tests/conftest.py b/tests/conftest.py index d446b30e..5a857913 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,16 +2,17 @@ # Copyright (c) 2023 Scipp contributors (https://github.com/scipp) import os +import sys from pathlib import Path from typing import Any, List import pytest import scipp as sc -# Load the config file in the test dir instead of the user's. -os.environ['SCIPPDIR'] = os.fspath(Path(__file__).resolve().parent) # Silence warning from Jupyter os.environ['JUPYTER_PLATFORM_DIRS'] = '1' +# To import helper modules +sys.path.insert(0, str(Path(__file__).resolve().parent)) pytest.register_assert_rewrite('scipp.testing.assertions')