Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions tests/tests_fabric/utilities/test_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,19 @@
cache.deprecation("test7")

output = stderr.getvalue()
assert "test_warnings.py:30: UserWarning: test1" in output
assert "test_warnings.py:31: DeprecationWarning: test2" in output

assert "test_warnings.py:33: UserWarning: test3" in output
assert "test_warnings.py:34: DeprecationWarning: test4" in output

assert "test_warnings.py:36: LightningDeprecationWarning: test5" in output

assert "test_warnings.py:39: UserWarning: test6" in output
assert "test_warnings.py:40: LightningDeprecationWarning: test7" in output
base_line = 30
expected_lines = [
f"test_warnings.py:{base_line}: UserWarning: test1",
f"test_warnings.py:{base_line+1}: DeprecationWarning: test2",
f"test_warnings.py:{base_line+3}: UserWarning: test3",
f"test_warnings.py:{base_line+4}: DeprecationWarning: test4",
f"test_warnings.py:{base_line+6}: LightningDeprecationWarning: test5",
f"test_warnings.py:{base_line+9}: UserWarning: test6",
f"test_warnings.py:{base_line+10}: LightningDeprecationWarning: test7",
]

for ln in expected_lines:
assert ln in output, f"Missing line {ln!r} in:\n{output}"

# check that logging is properly configured
import logging
Expand Down