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 Nov 9, 2020
1 parent 14bafa6 commit 8c3fbc5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions testing/acceptance_test.py
Expand Up @@ -1403,3 +1403,22 @@ def test_get_xdist_worker_id(self, fake_request):
assert xdist.get_xdist_worker_id(fake_request) == "gw5"
del fake_request.config.workerinput
assert xdist.get_xdist_worker_id(fake_request) == "master"


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 8c3fbc5

Please sign in to comment.