Skip to content

Commit 5998560

Browse files
Run debug test through pytest to reproduce actual crash
1 parent 61d204c commit 5998560

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

debug_unicode.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import warnings
55
import sys
6+
import pytest
67

78
def test_unicode_warning():
89
"""Test that triggers Unicode in warnings system - matches actual test behavior"""
@@ -19,11 +20,12 @@ def test_unicode_warning():
1920
decoded = result.decode('utf-8')
2021
assert decoded == unicode_string
2122

22-
# Trigger a warning with Unicode content (this is what causes the crash)
23+
# Trigger a warning with Unicode content (this is what causes the crash in pytest)
2324
warnings.warn(f"Test warning: {unicode_string}")
2425

2526
print("Test completed successfully")
2627

2728
if __name__ == "__main__":
28-
test_unicode_warning()
29+
# Run through pytest to trigger the actual crash
30+
pytest.main([__file__, "-v"])
2931

0 commit comments

Comments
 (0)