MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_levels

Method test_levels

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

Source from the content-addressed store, hash-verified

1080 return e
1081
1082 def test_levels(self):
1083 e1 = engines.testing_engine()
1084
1085 eq_(e1._should_log_info(), False)
1086 eq_(e1._should_log_debug(), False)
1087 eq_(e1.logger.isEnabledFor(logging.INFO), False)
1088 eq_(e1.logger.getEffectiveLevel(), logging.WARNING)
1089
1090 e1.echo = True
1091 eq_(e1._should_log_info(), True)
1092 eq_(e1._should_log_debug(), False)
1093 eq_(e1.logger.isEnabledFor(logging.INFO), True)
1094 eq_(e1.logger.getEffectiveLevel(), logging.INFO)
1095
1096 e1.echo = "debug"
1097 eq_(e1._should_log_info(), True)
1098 eq_(e1._should_log_debug(), True)
1099 eq_(e1.logger.isEnabledFor(logging.DEBUG), True)
1100 eq_(e1.logger.getEffectiveLevel(), logging.DEBUG)
1101
1102 e1.echo = False
1103 eq_(e1._should_log_info(), False)
1104 eq_(e1._should_log_debug(), False)
1105 eq_(e1.logger.isEnabledFor(logging.INFO), False)
1106 eq_(e1.logger.getEffectiveLevel(), logging.WARNING)
1107
1108 def test_echo_flag_independence(self):
1109 """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