Skip to content

Commit f199454

Browse files
committed
pytest: support non-top level dirs
Generalize `basepath` to support running from any directory.
1 parent 198cbb3 commit f199454

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
import itertools
4-
import os
4+
from pathlib import Path
55

66
import pytest
77

@@ -21,7 +21,7 @@
2121
from mpi4py import MPI # noqa
2222

2323
# base path for input files
24-
basepath = os.getcwd()
24+
basepath = Path(__file__).parent.parent
2525

2626

2727
@pytest.fixture(autouse=True, scope="function")

0 commit comments

Comments
 (0)