Skip to content

Commit 2a6225b

Browse files
committed
Handle that __file__ could return None
1 parent 588e2b2 commit 2a6225b

4 files changed

Lines changed: 4 additions & 0 deletions

File tree

tests/dataset/test_database_creation_and_upgrading.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
from tests.common import error_caused_by, skip_if_no_fixtures
5353
from tests.dataset.conftest import temporarily_copied_DB
5454

55+
assert tests.dataset.__file__ is not None
5556
fixturepath = os.sep.join(tests.dataset.__file__.split(os.sep)[:-1])
5657
fixturepath = os.path.join(fixturepath, "fixtures")
5758

tests/dataset/test_database_extract_runs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ def test_old_versions_not_touched(
744744

745745
_, new_v = get_db_version_and_newest_available_version(source_path)
746746

747+
assert tests.dataset.__file__ is not None
747748
fixturepath = os.sep.join(tests.dataset.__file__.split(os.sep)[:-1])
748749
fixturepath = os.path.join(
749750
fixturepath, "fixtures", "db_files", "version2", "some_runs.db"

tests/dataset/test_fix_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from tests.common import skip_if_no_fixtures
1919
from tests.dataset.conftest import temporarily_copied_DB
2020

21+
assert tests.dataset.__file__ is not None
2122
fixturepath = os.sep.join(tests.dataset.__file__.split(os.sep)[:-1])
2223
fixturepath = os.path.join(fixturepath, "fixtures")
2324

tests/drivers/test_tektronix_AWG70000A.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ def test_seqxfile_from_fs(forged_sequence) -> None:
205205
# typing convenience
206206
make_seqx = TektronixAWG70000Base.make_SEQX_from_forged_sequence
207207

208+
assert auxfiles.__file__ is not None
208209
path_to_schema = auxfiles.__file__.replace("__init__.py", "awgSeqDataSets.xsd")
209210

210211
with open(path_to_schema) as fid:

0 commit comments

Comments
 (0)