Skip to content

Commit b2dd97c

Browse files
committed
xmltok: test_xmltok: Find data file relative to module dir.
Allows to run via test aggregators.
1 parent ba14d0a commit b2dd97c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

xmltok/test_xmltok.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
('END_TAG', ('s', 'Envelope')),
1616
]
1717

18+
dir = "."
19+
if "/" in __file__:
20+
dir = __file__.rsplit("/", 1)[0]
21+
1822
ex = iter(expected)
19-
for i in xmltok.tokenize(open("test.xml")):
23+
for i in xmltok.tokenize(open(dir + "/test.xml")):
2024
#print(i)
2125
assert i == next(ex)

0 commit comments

Comments
 (0)