Skip to content

Commit dbee3fa

Browse files
committed
testing: remove conditionals for Python 3.11 beta releases
No need to support beta releases of an older version anymore. Ref: 09b2c95
1 parent ee9ea70 commit dbee3fa

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

testing/test_doctest.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# mypy: allow-untyped-defs
22
import inspect
33
from pathlib import Path
4-
import sys
54
import textwrap
65
from typing import Callable
76
from typing import Optional
@@ -224,11 +223,6 @@ def test_doctest_unexpected_exception(self, pytester: Pytester):
224223
"Traceback (most recent call last):",
225224
' File "*/doctest.py", line *, in __run',
226225
" *",
227-
*(
228-
(" *^^^^*",)
229-
if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11)
230-
else ()
231-
),
232226
' File "<doctest test_doctest_unexpected_exception.txt[1]>", line 1, in <module>',
233227
"ZeroDivisionError: division by zero",
234228
"*/test_doctest_unexpected_exception.txt:2: UnexpectedException",

testing/test_main.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import os
44
from pathlib import Path
55
import re
6-
import sys
76
from typing import Optional
87

98
from _pytest.config import ExitCode
@@ -45,32 +44,18 @@ def pytest_internalerror(excrepr, excinfo):
4544
assert result.ret == ExitCode.INTERNAL_ERROR
4645
assert result.stdout.lines[0] == "INTERNALERROR> Traceback (most recent call last):"
4746

48-
end_lines = (
49-
result.stdout.lines[-4:]
50-
if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11)
51-
else result.stdout.lines[-3:]
52-
)
47+
end_lines = result.stdout.lines[-3:]
5348

5449
if exc == SystemExit:
5550
assert end_lines == [
5651
f'INTERNALERROR> File "{c1}", line 4, in pytest_sessionstart',
5752
'INTERNALERROR> raise SystemExit("boom")',
58-
*(
59-
("INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^",)
60-
if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11)
61-
else ()
62-
),
6353
"INTERNALERROR> SystemExit: boom",
6454
]
6555
else:
6656
assert end_lines == [
6757
f'INTERNALERROR> File "{c1}", line 4, in pytest_sessionstart',
6858
'INTERNALERROR> raise ValueError("boom")',
69-
*(
70-
("INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^",)
71-
if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11)
72-
else ()
73-
),
7459
"INTERNALERROR> ValueError: boom",
7560
]
7661
if returncode is False:

0 commit comments

Comments
 (0)