From 43968e3ad4eceebfe75e971318c1da02aff4ddc2 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 d93f08ed..3d4f9842 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -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 *", + ] + )