MCPcopy Index your code
hub / github.com/python/cpython / test_stream_setting

Method test_stream_setting

Lib/test/test_logging.py:853–865  ·  view source on GitHub ↗

Test setting the handler's stream

(self)

Source from the content-addressed store, hash-verified

851 logging.raiseExceptions = old_raise
852
853 def test_stream_setting(self):
854 """
855 Test setting the handler's stream
856 """
857 h = logging.StreamHandler()
858 stream = io.StringIO()
859 old = h.setStream(stream)
860 self.assertIs(old, sys.stderr)
861 actual = h.setStream(old)
862 self.assertIs(actual, stream)
863 # test that setting to existing value returns None
864 actual = h.setStream(old)
865 self.assertIsNone(actual)
866
867 def test_can_represent_stream_with_int_name(self):
868 h = logging.StreamHandler(StreamWithIntName())

Callers

nothing calls this directly

Calls 3

setStreamMethod · 0.95
assertIsNoneMethod · 0.80
assertIsMethod · 0.45

Tested by

no test coverage detected