Skip to content

Commit

Permalink
Merge pull request #192 from scipp/pytest-importmode
Browse files Browse the repository at this point in the history
Use pytest importlib import mode
  • Loading branch information
jl-wynen authored Jan 30, 2024
2 parents a370773 + 14d9df6 commit 58ffbbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ minversion = "7.0"
addopts = """
--strict-config
--strict-markers
--import-mode=importlib
-ra
-v
-m 'not externalfile'
Expand Down
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit 58ffbbe

Please sign in to comment.