Skip to content

Commit d114cb5

Browse files
Merge pull request #18 from jeromekelleher/fix-ci
Fixup buggy test
2 parents a86b683 + 96a1a14 commit d114cb5

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

tests/test_formats.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
encoder whose ``total_size`` reflects the same selection.
77
"""
88

9-
import pathlib
109
import sqlite3
1110
import tempfile
1211

@@ -91,12 +90,11 @@ def test_bgi_schema_columns(self, fx_reader, tmp_path):
9190
"size_in_bytes",
9291
} <= columns
9392

94-
def test_tempfile_cleaned_up(self, fx_reader):
95-
tmpdir = pathlib.Path(tempfile.gettempdir())
96-
before = {p.name for p in tmpdir.glob("biofuse-bgen-*")}
93+
def test_tempfile_cleaned_up(self, fx_reader, tmp_path, monkeypatch):
94+
monkeypatch.setattr(tempfile, "tempdir", str(tmp_path))
9795
formats.BGEN_SPEC.build_static_files(fx_reader)
98-
after = {p.name for p in tmpdir.glob("biofuse-bgen-*")}
99-
assert after == before, f"left behind: {after - before}"
96+
leftovers = list(tmp_path.glob("biofuse-bgen-*"))
97+
assert leftovers == [], f"left behind: {leftovers}"
10098

10199
def test_encoder_total_size_is_fixed_size_layout(self, fx_reader):
102100
with formats.BGEN_SPEC.encoder_factory(fx_reader) as encoder:

0 commit comments

Comments
 (0)