MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_levels

Method test_levels

test/engine/test_logging.py:1084–1108  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1082 return e
1083
1084 def test_levels(self):
1085 e1 = engines.testing_engine()
1086
1087 eq_(e1._should_log_info(), False)
1088 eq_(e1._should_log_debug(), False)
1089 eq_(e1.logger.isEnabledFor(logging.INFO), False)
1090 eq_(e1.logger.getEffectiveLevel(), logging.WARNING)
1091
1092 e1.echo = True
1093 eq_(e1._should_log_info(), True)
1094 eq_(e1._should_log_debug(), False)
1095 eq_(e1.logger.isEnabledFor(logging.INFO), True)
1096 eq_(e1.logger.getEffectiveLevel(), logging.INFO)
1097
1098 e1.echo = "debug"
1099 eq_(e1._should_log_info(), True)
1100 eq_(e1._should_log_debug(), True)
1101 eq_(e1.logger.isEnabledFor(logging.DEBUG), True)
1102 eq_(e1.logger.getEffectiveLevel(), logging.DEBUG)
1103
1104 e1.echo = False
1105 eq_(e1._should_log_info(), False)
1106 eq_(e1._should_log_debug(), False)
1107 eq_(e1.logger.isEnabledFor(logging.INFO), False)
1108 eq_(e1.logger.getEffectiveLevel(), logging.WARNING)
1109
1110 def test_echo_flag_independence(self):
1111 """test the echo flag's independence to a specific engine."""

Callers

nothing calls this directly

Calls 6

eq_Function · 0.90
testing_engineMethod · 0.80
_should_log_infoMethod · 0.80
_should_log_debugMethod · 0.80
isEnabledForMethod · 0.80
getEffectiveLevelMethod · 0.80

Tested by

no test coverage detected