File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
tests/tests_fabric/utilities Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 4040 cache .deprecation ("test7" )
4141
4242 output = stderr .getvalue ()
43- assert "test_warnings.py:30: UserWarning: test1" in output
44- assert "test_warnings.py:31: DeprecationWarning: test2" in output
45-
46- assert "test_warnings.py:33: UserWarning: test3" in output
47- assert "test_warnings.py:34: DeprecationWarning: test4" in output
48-
49- assert "test_warnings.py:36: LightningDeprecationWarning: test5" in output
50-
51- assert "test_warnings.py:39: UserWarning: test6" in output
52- assert "test_warnings.py:40: LightningDeprecationWarning: test7" in output
43+ base_line = 30
44+ expected_lines = [
45+ f"test_warnings.py:{ base_line } : UserWarning: test1" ,
46+ f"test_warnings.py:{ base_line + 1 } : DeprecationWarning: test2" ,
47+ f"test_warnings.py:{ base_line + 3 } : UserWarning: test3" ,
48+ f"test_warnings.py:{ base_line + 4 } : DeprecationWarning: test4" ,
49+ f"test_warnings.py:{ base_line + 6 } : LightningDeprecationWarning: test5" ,
50+ f"test_warnings.py:{ base_line + 9 } : UserWarning: test6" ,
51+ f"test_warnings.py:{ base_line + 10 } : LightningDeprecationWarning: test7" ,
52+ ]
53+
54+ for ln in expected_lines :
55+ assert ln in output , f"Missing line { ln !r} in:\n { output } "
5356
5457 # check that logging is properly configured
5558 import logging
You can’t perform that action at this time.
0 commit comments