MCPcopy Create free account
hub / github.com/vispy/vispy / test_debug_logging

Function test_debug_logging

vispy/util/tests/test_logging.py:22–42  ·  view source on GitHub ↗

Test advanced debugging logging

()

Source from the content-addressed store, hash-verified

20
21
22def test_debug_logging():
23 """Test advanced debugging logging"""
24 with use_log_level('debug', 'Selected', True, False) as emit_list:
25 logger.debug('Selected foo')
26 assert_equal(len(emit_list), 1)
27 assert_in('test_logging', emit_list[0]) # can't really parse this location
28
29 with use_log_level('debug', record=True, print_msg=False) as emit_list:
30 logger.debug('foo')
31 assert_equal(len(emit_list), 1)
32 assert_in('test_logging', emit_list[0])
33
34 with use_log_level('debug', 'foo', True, False) as emit_list:
35 logger.debug('bar')
36 assert_equal(len(emit_list), 0)
37
38 with use_log_level('info', record=True, print_msg=False) as emit_list:
39 logger.debug('foo')
40 logger.info('bar')
41 assert_equal(len(emit_list), 1)
42 assert_not_in('unknown', emit_list[0])
43
44
45run_tests_if_main()

Callers

nothing calls this directly

Calls 4

use_log_levelClass · 0.90
assert_equalFunction · 0.90
assert_inFunction · 0.90
assert_not_inFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…