Skip to content

Commit 077259b

Browse files
committed
Tighten up test_warnings
1 parent 667e8c8 commit 077259b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

product/runtime/src/test/python/chaquopy/test/test_android.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,11 +1060,11 @@ def test_time(self):
10601060

10611061
def test_warnings(self):
10621062
import warnings
1063-
# The default "ignore" filters should have been removed, and the only filters in
1064-
# effect should be those inserted by the unit test framework.
1065-
for i, filter in enumerate(warnings.filters):
1066-
with self.subTest(index=i, filter=filter):
1067-
self.assertNotEqual("ignore", filter[0])
1063+
# The default "ignore" filters should have been removed. And despite what the
1064+
# documentation says, the unit test framework inserts its filters not in the
1065+
# TextTestRunner, but in unittest.main, which we're not using. So the only active
1066+
# filter should be the one inserted by FilterWarningsCase.
1067+
self.assertEqual([("error", None, Warning, None, 0)], warnings.filters)
10681068

10691069

10701070
class TestAndroidStreams(AndroidTestCase):

0 commit comments

Comments
 (0)