Some pytest plugins needs to be disabled because they produce unexpected output. --- pytest-relaxed-2.0.2/tests/test_collection.py.orig +++ pytest-relaxed-2.0.2/tests/test_collection.py @@ -41,7 +41,7 @@ """ ) # TODO: why Result.str() and not str(Result)? Seems unPythonic - stdout = testdir.runpytest().stdout.str() + stdout = testdir.runpytest("-p", "no:cov", "-p", "no:black").stdout.str() assert "hastests.py" in stdout assert "_util.py" not in stdout @@ -80,7 +80,7 @@ pass """ ) - stdout = testdir.runpytest().stdout.str() + stdout = testdir.runpytest("-p", "no:cov", "-p", "no:black", "-p", "no:mypy").stdout.str() assert "actual_tests.py" in stdout assert "conftest.py" not in stdout @@ -118,7 +118,7 @@ pass """ ) - stdout = testdir.runpytest("-v").stdout.str() + stdout = testdir.runpytest("-v", "-p", "no:black").stdout.str() for substring in ( "hello how are you", "please test me thx", @@ -192,7 +192,7 @@ pass """ ) - stdout = testdir.runpytest("-v").stdout.str() + stdout = testdir.runpytest("-v", "-p", "no:black").stdout.str() assert "actual test here" in stdout # will be in stdout as a failure and warning if bug present assert "pls_noload" not in stdout @@ -216,7 +216,7 @@ assert self.some_attr == 17 """ ) - assert testdir.runpytest().ret is ExitCode.OK + assert testdir.runpytest("-p", "no:black").ret is ExitCode.OK def test_setup_method_given_inner_class_instances(self, testdir): testdir.makepyfile( @@ -230,7 +230,7 @@ assert self.some_attr == 17 """ ) - assert testdir.runpytest().ret is ExitCode.OK + assert testdir.runpytest("-p", "no:black").ret is ExitCode.OK class TestSpecModule: @@ -243,7 +243,7 @@ pass """ ) - stdout = testdir.runpytest("-v").stdout.str() + stdout = testdir.runpytest("-v", "-p", "no:black").stdout.str() assert "some_uncallable" not in stdout def test_skips_imported_objects(self, testdir): @@ -267,7 +267,7 @@ pass """ ) - stdout = testdir.runpytest("-v").stdout.str() + stdout = testdir.runpytest("-v", "-p", "no:black", "-p", "no:helpers_namespace").stdout.str() assert "a test is me" in stdout assert "helper" not in stdout assert "Helper" not in stdout @@ -342,7 +342,7 @@ pass """ ) - stdout = testdir.runpytest("-v").stdout.str() + stdout = testdir.runpytest("-v", "-p", "no:black", "-p", "no:mypy").stdout.str() expected = """ MyStuff @@ -381,7 +381,7 @@ # TODO: first thought was "why is this not automatic?", then realized # "duh, it'd be annoying if you wanted to test failure related behavior # a lot"...but still want some slightly nicer helper I think - assert testdir.runpytest().ret is ExitCode.OK + assert testdir.runpytest("-p", "no:black").ret is ExitCode.OK def test_nested_self_objects_exhibit_parent_attributes(self, testdir): # TODO: really starting to think going back to 'real' fixture files @@ -398,7 +398,7 @@ assert self.an_attr == 5 """ ) - assert testdir.runpytest().ret is ExitCode.OK + assert testdir.runpytest("-p", "no:black").ret is ExitCode.OK def test_nesting_is_infinite(self, testdir): testdir.makepyfile( @@ -414,7 +414,7 @@ assert self.an_attr == 5 """ ) - assert testdir.runpytest().ret is ExitCode.OK + assert testdir.runpytest("-p", "no:black").ret is ExitCode.OK def test_overriding_works_naturally(self, testdir): testdir.makepyfile( @@ -429,7 +429,7 @@ assert self.an_attr == 7 """ ) - assert testdir.runpytest().ret is ExitCode.OK + assert testdir.runpytest("-p", "no:black").ret is ExitCode.OK def test_normal_methods_from_outer_classes_are_not_copied(self, testdir): testdir.makepyfile( @@ -443,7 +443,7 @@ assert not hasattr(self, 'outer_test') """ ) - assert testdir.runpytest().ret is ExitCode.OK + assert testdir.runpytest("-p", "no:black").ret is ExitCode.OK def test_private_methods_from_outer_classes_are_copied(self, testdir): testdir.makepyfile( @@ -461,7 +461,7 @@ assert hasattr(self, '_outer_helper') """ ) - assert testdir.runpytest().ret is ExitCode.OK + assert testdir.runpytest("-p", "no:black").ret is ExitCode.OK def test_module_contents_are_not_copied_into_top_level_classes( self, testdir @@ -475,4 +475,4 @@ assert not hasattr(self, 'module_constant') """ ) - assert testdir.runpytest().ret is ExitCode.OK + assert testdir.runpytest("-p", "no:black").ret is ExitCode.OK --- pytest-relaxed-2.0.2/tests/test_display.py.orig +++ pytest-relaxed-2.0.2/tests/test_display.py @@ -10,7 +10,7 @@ def _expect_regular_output(testdir): - output = testdir.runpytest().stdout.str() + output = testdir.runpytest("-p", "no:black", "-p", "no:mypy", "-p", "no:randomly").stdout.str() # Regular results w/ status letters assert "behaviors.py .." in output assert "other_behaviors.py s.F." in output @@ -77,7 +77,7 @@ some things other things """.lstrip() - output = testdir.runpytest_subprocess("-v").stdout.str() + output = testdir.runpytest_subprocess("-v", "-p", "no:black", "-p", "no:randomly").stdout.str() assert expected in output @@ -147,7 +147,7 @@ assert False """, ) - output = testdir.runpytest_subprocess("-v").stdout.str() + output = testdir.runpytest_subprocess("-v", "-p", "no:black", "-p", "no:mypy", "-p", "no:randomly").stdout.str() results = """ Behaviors @@ -200,7 +200,7 @@ assert False """, ) - output = testdir.runpytest_subprocess("-v").stdout.str() + output = testdir.runpytest_subprocess("-v", "-p", "no:black", "-p", "no:mypy", "-p", "no:randomly").stdout.str() results = """ Behaviors @@ -272,7 +272,7 @@ yup still works """.lstrip() - assert expected in testdir.runpytest("-v").stdout.str() + assert expected in testdir.runpytest("-v", "-p", "no:black", "-p", "no:randomly").stdout.str() def test_headers_and_tests_have_underscores_turn_to_spaces(self, testdir): testdir.makepyfile( @@ -303,7 +303,7 @@ the stuff """.lstrip() - assert expected in testdir.runpytest("-v").stdout.str() + assert expected in testdir.runpytest("-v", "-p", "no:black", "-p", "no:mypy").stdout.str() def test_test_suffixes_are_stripped(self, testdir): testdir.makepyfile( @@ -319,7 +319,7 @@ yup """.lstrip() - assert expected in testdir.runpytest("-v").stdout.str() + assert expected in testdir.runpytest("-v", "-p", "no:black", "-p", "no:mypy").stdout.str() class TestNormalMixed: