Skip to content

Commit 5fc0517

Browse files
committed
Set pytest's import mode to importlib
1 parent 26c7467 commit 5fc0517

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import os
2+
import sys
3+
from pathlib import Path
24

35
import pytest
46

57

8+
repo_root = Path(__file__).parent
9+
sys.path.insert(0, str(repo_root))
10+
11+
612
def pytest_sessionstart(session):
713
os.environ["PYTENSOR_FLAGS"] = ",".join(
814
[

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ versionfile_build = "pytensor/_version.py"
117117
tag_prefix = "rel-"
118118

119119
[tool.pytest]
120-
addopts = "--durations=50 --doctest-modules pytensor --ignore=pytensor/misc/check_duplicate_key.py --ignore=pytensor/link"
120+
addopts = "--durations=50 --doctest-modules pytensor --import-mode=importlib --ignore=pytensor/misc/check_duplicate_key.py --ignore=pytensor/link"
121121
testpaths = "tests/"
122122

123123
[tool.ruff]

0 commit comments

Comments
 (0)