Skip to content

Commit 69d9b64

Browse files
Can't use assertNoLogs below Python 3.10
1 parent 7a77cba commit 69d9b64

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cardinal_pythonlib/sqlalchemy/tests/schema_tests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import logging
3030
import unittest
31+
import sys
3132

3233
from sqlalchemy import event, inspect, select
3334
from sqlalchemy.dialects.mssql.base import MSDialect, DECIMAL as MS_DECIMAL
@@ -697,6 +698,12 @@ def test_ddl_dialect_conditionality_2(self) -> None:
697698
bind=self.engine, future=True
698699
)() # type: Session
699700

701+
if sys.version_info < (3, 10):
702+
log.warning(
703+
"Unable to use unittest.TestCase.assertNoLogs; "
704+
"needs Python 3.10; skipping test"
705+
)
706+
return
700707
with self.assertNoLogs(level=logging.INFO):
701708
with if_sqlserver_disable_constraints(session, tablename="person"):
702709
pass

0 commit comments

Comments
 (0)