1111
1212
1313class TestMatchesReStart :
14- def test_simple_no_class (self ):
14+ def test_simple_no_class (self ) -> None :
1515 s = "!$######tests.test_foo:test_bar:target_func:1:abc######$!\n "
1616 m = matches_re_start .search (s )
1717 assert m is not None
1818 assert m .groups () == ("tests.test_foo" , "" , "test_bar" , "target_func" , "1" , "abc" )
1919
20- def test_with_class (self ):
20+ def test_with_class (self ) -> None :
2121 s = "!$######tests.test_foo:MyClass.test_bar:target_func:1:abc######$!\n "
2222 m = matches_re_start .search (s )
2323 assert m is not None
2424 assert m .groups () == ("tests.test_foo" , "MyClass." , "test_bar" , "target_func" , "1" , "abc" )
2525
26- def test_nested_class (self ):
26+ def test_nested_class (self ) -> None :
2727 s = "!$######a.b.c:A.B.test_x:func:3:id123######$!\n "
2828 m = matches_re_start .search (s )
2929 assert m is not None
3030 assert m .groups () == ("a.b.c" , "A.B." , "test_x" , "func" , "3" , "id123" )
3131
32- def test_empty_class_and_function (self ):
32+ def test_empty_class_and_function (self ) -> None :
3333 s = "!$######mod::func:0:iter######$!\n "
3434 m = matches_re_start .search (s )
3535 assert m is not None
3636 assert m .groups () == ("mod" , "" , "" , "func" , "0" , "iter" )
3737
38- def test_embedded_in_stdout (self ):
38+ def test_embedded_in_stdout (self ) -> None :
3939 s = "some output\n !$######mod:test_fn:f:1:x######$!\n more output\n "
4040 m = matches_re_start .search (s )
4141 assert m is not None
4242 assert m .groups () == ("mod" , "" , "test_fn" , "f" , "1" , "x" )
4343
44- def test_multiple_matches (self ):
44+ def test_multiple_matches (self ) -> None :
4545 s = (
4646 "!$######m1:C1.fn1:t1:1:a######$!\n "
4747 "!$######m2:fn2:t2:2:b######$!\n "
@@ -51,12 +51,12 @@ def test_multiple_matches(self):
5151 assert matches [0 ].groups () == ("m1" , "C1." , "fn1" , "t1" , "1" , "a" )
5252 assert matches [1 ].groups () == ("m2" , "" , "fn2" , "t2" , "2" , "b" )
5353
54- def test_no_match_without_newline (self ):
54+ def test_no_match_without_newline (self ) -> None :
5555 s = "!$######mod:test_fn:f:1:x######$!"
5656 m = matches_re_start .search (s )
5757 assert m is None
5858
59- def test_dots_in_module_path (self ):
59+ def test_dots_in_module_path (self ) -> None :
6060 s = "!$######a.b.c.d.e:test_fn:f:1:x######$!\n "
6161 m = matches_re_start .search (s )
6262 assert m is not None
@@ -67,32 +67,32 @@ def test_dots_in_module_path(self):
6767
6868
6969class TestMatchesReEnd :
70- def test_simple_no_class_with_runtime (self ):
70+ def test_simple_no_class_with_runtime (self ) -> None :
7171 s = "!######tests.test_foo:test_bar:target_func:1:abc:12345######!"
7272 m = matches_re_end .search (s )
7373 assert m is not None
7474 assert m .groups () == ("tests.test_foo" , "" , "test_bar" , "target_func" , "1" , "abc:12345" )
7575
76- def test_with_class_no_runtime (self ):
76+ def test_with_class_no_runtime (self ) -> None :
7777 s = "!######tests.test_foo:MyClass.test_bar:target_func:1:abc######!"
7878 m = matches_re_end .search (s )
7979 assert m is not None
8080 assert m .groups () == ("tests.test_foo" , "MyClass." , "test_bar" , "target_func" , "1" , "abc" )
8181
82- def test_nested_class_with_runtime (self ):
82+ def test_nested_class_with_runtime (self ) -> None :
8383 s = "!######mod:A.B.test_x:func:3:id123:99999######!"
8484 m = matches_re_end .search (s )
8585 assert m is not None
8686 assert m .groups () == ("mod" , "A.B." , "test_x" , "func" , "3" , "id123:99999" )
8787
88- def test_runtime_colon_preserved_in_group6 (self ):
88+ def test_runtime_colon_preserved_in_group6 (self ) -> None :
8989 """Group 6 must capture 'iteration_id:runtime' as a single string (colon included)."""
9090 s = "!######m:fn:f:1:iter42:98765######!"
9191 m = matches_re_end .search (s )
9292 assert m is not None
9393 assert m .group (6 ) == "iter42:98765"
9494
95- def test_embedded_in_stdout (self ):
95+ def test_embedded_in_stdout (self ) -> None :
9696 s = "captured output\n !######mod:test_fn:f:1:x:500######!\n more"
9797 m = matches_re_end .search (s )
9898 assert m is not None
@@ -103,7 +103,7 @@ def test_embedded_in_stdout(self):
103103
104104
105105class TestStartEndPairing :
106- def test_paired_markers (self ):
106+ def test_paired_markers (self ) -> None :
107107 stdout = (
108108 "!$######mod:Class.test_fn:func:1:iter1######$!\n "
109109 "test output here\n "
@@ -132,7 +132,7 @@ def test_paired_markers(self):
132132
133133
134134class TestParseTestFailuresHeader :
135- def test_standard_pytest_header (self ):
135+ def test_standard_pytest_header (self ) -> None :
136136 stdout = (
137137 "..F.\n "
138138 "=================================== FAILURES ===================================\n "
@@ -149,7 +149,7 @@ def test_standard_pytest_header(self):
149149 result = parse_test_failures_from_stdout (stdout )
150150 assert "test_foo" in result
151151
152- def test_minimal_equals (self ):
152+ def test_minimal_equals (self ) -> None :
153153 """Even a short '= FAILURES =' header should be detected."""
154154 stdout = (
155155 "= FAILURES =\n "
@@ -163,12 +163,12 @@ def test_minimal_equals(self):
163163 result = parse_test_failures_from_stdout (stdout )
164164 assert "test_bar" in result
165165
166- def test_no_failures_section (self ):
166+ def test_no_failures_section (self ) -> None :
167167 stdout = "....\n 4 passed in 0.1s\n "
168168 result = parse_test_failures_from_stdout (stdout )
169169 assert result == {}
170170
171- def test_word_failures_without_equals_is_not_matched (self ):
171+ def test_word_failures_without_equals_is_not_matched (self ) -> None :
172172 """'FAILURES' without surrounding '=' signs should not trigger the header detection."""
173173 stdout = (
174174 "FAILURES detected in module\n "
@@ -179,7 +179,7 @@ def test_word_failures_without_equals_is_not_matched(self):
179179 result = parse_test_failures_from_stdout (stdout )
180180 assert result == {}
181181
182- def test_failures_in_test_output_not_matched (self ):
182+ def test_failures_in_test_output_not_matched (self ) -> None :
183183 """A test printing 'FAILURES' (no = signs) should not trigger header detection."""
184184 stdout = (
185185 "Testing FAILURES handling\n "
0 commit comments