From daba7ceb7116b2f402f01f80814c833b5a8370db Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 2 Oct 2020 13:23:41 -0700 Subject: [PATCH] py36+: remove requires_ordered_markup --- testing/conftest.py | 22 ---------------------- testing/test_terminal.py | 3 --- 2 files changed, 25 deletions(-) diff --git a/testing/conftest.py b/testing/conftest.py index a667be42f..62a2b4a22 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -3,7 +3,6 @@ import sys from typing import List import pytest -from _pytest.pytester import RunResult from _pytest.pytester import Testdir if sys.gettrace(): @@ -175,27 +174,6 @@ def color_mapping(): """Replace color names for use with LineMatcher.re_match_lines""" return [line.format(**cls.RE_COLORS) for line in lines] - @classmethod - def requires_ordered_markup(cls, result: RunResult): - """Should be called if a test expects markup to appear in the output - in the order they were passed, for example: - - tw.write(line, bold=True, red=True) - - In Python 3.5 there's no guarantee that the generated markup will appear - in the order called, so we do some limited color testing and skip the rest of - the test. - """ - if sys.version_info < (3, 6): - # terminal writer.write accepts keyword arguments, so - # py36+ is required so the markup appears in the expected order - output = result.stdout.str() - assert "test session starts" in output - assert "\x1b[1m" in output - pytest.skip( - "doing limited testing because lacking ordered markup on py35" - ) - return ColorMapping diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 57db1b9a5..859e1470e 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -1017,7 +1017,6 @@ def test_color_yes(testdir, color_mapping): """ ) result = testdir.runpytest("--color=yes", str(p1)) - color_mapping.requires_ordered_markup(result) result.stdout.fnmatch_lines( color_mapping.format_for_fnmatch( [ @@ -2217,7 +2216,6 @@ class TestCodeHighlight: """ ) result = testdir.runpytest("--color=yes") - color_mapping.requires_ordered_markup(result) result.stdout.fnmatch_lines( color_mapping.format_for_fnmatch( [ @@ -2237,7 +2235,6 @@ class TestCodeHighlight: """ ) result = testdir.runpytest("--color=yes") - color_mapping.requires_ordered_markup(result) result.stdout.fnmatch_lines( color_mapping.format_for_fnmatch(