Skip to content

Commit a23666d

Browse files
authored
Merge pull request #7838 from asottile/py36_requires_ordered_markup
py36+: remove requires_ordered_markup
2 parents ced0a52 + daba7ce commit a23666d

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

testing/conftest.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import List
44

55
import pytest
6-
from _pytest.pytester import RunResult
76
from _pytest.pytester import Testdir
87

98
if sys.gettrace():
@@ -175,27 +174,6 @@ def format_for_rematch(cls, lines: List[str]) -> List[str]:
175174
"""Replace color names for use with LineMatcher.re_match_lines"""
176175
return [line.format(**cls.RE_COLORS) for line in lines]
177176

178-
@classmethod
179-
def requires_ordered_markup(cls, result: RunResult):
180-
"""Should be called if a test expects markup to appear in the output
181-
in the order they were passed, for example:
182-
183-
tw.write(line, bold=True, red=True)
184-
185-
In Python 3.5 there's no guarantee that the generated markup will appear
186-
in the order called, so we do some limited color testing and skip the rest of
187-
the test.
188-
"""
189-
if sys.version_info < (3, 6):
190-
# terminal writer.write accepts keyword arguments, so
191-
# py36+ is required so the markup appears in the expected order
192-
output = result.stdout.str()
193-
assert "test session starts" in output
194-
assert "\x1b[1m" in output
195-
pytest.skip(
196-
"doing limited testing because lacking ordered markup on py35"
197-
)
198-
199177
return ColorMapping
200178

201179

testing/test_terminal.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,6 @@ def test_this():
10171017
"""
10181018
)
10191019
result = testdir.runpytest("--color=yes", str(p1))
1020-
color_mapping.requires_ordered_markup(result)
10211020
result.stdout.fnmatch_lines(
10221021
color_mapping.format_for_fnmatch(
10231022
[
@@ -2217,7 +2216,6 @@ def test_foo():
22172216
"""
22182217
)
22192218
result = testdir.runpytest("--color=yes")
2220-
color_mapping.requires_ordered_markup(result)
22212219
result.stdout.fnmatch_lines(
22222220
color_mapping.format_for_fnmatch(
22232221
[
@@ -2237,7 +2235,6 @@ def test_foo():
22372235
"""
22382236
)
22392237
result = testdir.runpytest("--color=yes")
2240-
color_mapping.requires_ordered_markup(result)
22412238

22422239
result.stdout.fnmatch_lines(
22432240
color_mapping.format_for_fnmatch(

0 commit comments

Comments
 (0)