Skip to content

Commit 0b8e817

Browse files
committed
test_doctest_id: avoid UnboundLocalError with internal errors
1 parent 978c7ae commit 0b8e817

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

testing/acceptance_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,10 +861,12 @@ def test_doctest_id(self, testdir):
861861
)
862862
result = testdir.runpytest("-rf")
863863
lines = result.stdout.str().splitlines()
864+
testid = None
864865
for line in lines:
865866
if line.startswith(("FAIL ", "FAILED ")):
866867
_fail, _sep, testid = line.partition(" ")
867868
break
869+
assert testid is not None
868870
result = testdir.runpytest(testid, "-rf")
869871
result.stdout.fnmatch_lines(
870872
["FAILED test_doctest_id.txt::test_doctest_id.txt", "*1 failed*"]

0 commit comments

Comments
 (0)