From d137384315c9887115ce4c44a3153e77a2be6eb9 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 30 Mar 2020 23:57:01 +0200 Subject: [PATCH] Add test_collection_crash Reproduces: INTERNALERROR> TypeError: unhashable type: 'ExceptionChainRepr' Ref: https://github.com/pytest-dev/pytest-xdist/issues/515 Ref: https://github.com/pytest-dev/pytest/pull/6988 --- testing/acceptance_test.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 3407272..05bd9bf 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1543,3 +1543,22 @@ class TestAPI: 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 *", + ] + )