diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 098e106f9..bdfbf823c 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1197,6 +1197,29 @@ class TestIssue2121: result.stdout.fnmatch_lines("*E*assert (1 + 1) == 3") +@pytest.mark.parametrize("offset", [-1, +1]) +def test_source_mtime_long_long(testdir, offset): + """Support modification dates after 2038 in rewritten files (#4903). + + pytest would crash with: + + fp.write(struct.pack("