Test advanced debugging logging
()
| 20 | |
| 21 | |
| 22 | def 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 | |
| 45 | run_tests_if_main() |
nothing calls this directly
no test coverage detected
searching dependent graphs…