MCPcopy
hub / github.com/django/django / test_context_manager

Method test_context_manager

tests/test_utils/tests.py:1335–1337  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1333
1334class AssertWarnsMessageTests(SimpleTestCase):
1335 def test_context_manager(self):
1336 with self.assertWarnsMessage(UserWarning, "Expected message"):
1337 warnings.warn("Expected message", UserWarning)
1338
1339 def test_context_manager_failure(self):
1340 msg = "Expected message' not found in 'Unexpected message'"

Callers

nothing calls this directly

Calls 1

assertWarnsMessageMethod · 0.80

Tested by

no test coverage detected