Skip to content

Commit e6588ef

Browse files
committed
Try parsing from a string
Something's wrong with the mmap-based parsing of GFA files from Python-land on Windows... just avoid it altogether?
1 parent ff638b6 commit e6588ef

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

flatgfa-py/test/test_flatgfa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
import pathlib
44

55
TEST_DIR = pathlib.Path(__file__).parent
6-
TEST_GFA = str(TEST_DIR / "tiny.gfa")
6+
TEST_GFA = TEST_DIR / "tiny.gfa"
77

88

99
@pytest.fixture
1010
def gfa():
11-
return flatgfa.parse(TEST_GFA)
11+
return flatgfa.parse_bytes(TEST_GFA.read_bytes())
1212

1313

1414
def test_segs(gfa):

flatgfa-py/test/test_gaf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
import flatgfa
33

44
TEST_DIR = pathlib.Path(__file__).parent
5-
TEST_GFA = str(TEST_DIR / "tiny.gfa")
6-
TEST_GAF = str(TEST_DIR / "tiny.gaf")
5+
TEST_GFA = TEST_DIR / "tiny.gfa"
6+
TEST_GAF = TEST_DIR / "tiny.gaf"
77

88

99
def test_gaf_seqs():
10-
gfa = flatgfa.parse(TEST_GFA)
11-
gaf = gfa.all_reads(TEST_GAF)
10+
gfa = flatgfa.parse_bytes(TEST_GFA.read_bytes())
11+
gaf = gfa.all_reads(str(TEST_GAF))
1212
seqs = ["".join(e.sequence() for e in line) for line in gaf]
1313
assert seqs == [
1414
"AAGAAATTTTCT",
@@ -17,8 +17,8 @@ def test_gaf_seqs():
1717

1818

1919
def test_gaf_ranges():
20-
gfa = flatgfa.parse(TEST_GFA)
21-
gaf = gfa.all_reads(TEST_GAF)
20+
gfa = flatgfa.parse_bytes(TEST_GFA.read_bytes())
21+
gaf = gfa.all_reads(str(TEST_GAF))
2222
ranges = [[e.range for e in line] for line in gaf]
2323
assert ranges == [
2424
[(5, 8), (0, 9), (1, 0)],

0 commit comments

Comments
 (0)