David Stes
2024-03-31 8cdd197ba643eb2608c5aab87567625bb9336cee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
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: