Skip to content

Commit

Permalink
Add test_collection_crash
Browse files Browse the repository at this point in the history
Reproduces:

    INTERNALERROR> TypeError: unhashable type: 'ExceptionChainRepr'

Ref: pytest-dev#515
Ref: pytest-dev/pytest#6988
  • Loading branch information
blueyed committed Mar 30, 2020
1 parent 6fd5b56 commit 43968e3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions testing/acceptance_test.py
Expand Up @@ -1377,3 +1377,22 @@ def get_workers_and_test_count_by_prefix(prefix, lines, expected_status="PASSED"
if expected_status == status and nodeid.startswith(prefix):
result[worker] = result.get(worker, 0) + 1
return result


def test_collection_crash(testdir):
p1 = testdir.makepyfile(
"""
assert 0
"""
)
result = testdir.runpytest(p1, "-n1")
assert result.ret == 1
result.stdout.fnmatch_lines(
[
"gw0 I",
"gw0 [[]0[]]",
"*_ ERROR collecting test_collection_crash.py _*",
"E assert 0",
"*= 1 error in *",
]
)

0 comments on commit 43968e3

Please sign in to comment.