MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / conditional_sane_rowcount_warnings

Function conditional_sane_rowcount_warnings

test/orm/test_versioning.py:47–66  ·  view source on GitHub ↗
(
    update=False, delete=False, only_returning=False
)

Source from the content-addressed store, hash-verified

45
46@contextlib.contextmanager
47def conditional_sane_rowcount_warnings(
48 update=False, delete=False, only_returning=False
49):
50 warnings = ()
51 if not testing.db.dialect.supports_sane_rowcount:
52 if update:
53 warnings += (
54 "Dialect .* does not support "
55 "updated rowcount - versioning cannot be verified.",
56 )
57 if delete:
58 warnings += (
59 "Dialect .* does not support "
60 "deleted rowcount - versioning cannot be verified.",
61 )
62
63 with expect_warnings(*warnings):
64 yield
65 else:
66 yield
67
68
69class NullVersionIdTest(fixtures.MappedTest):

Calls 1

expect_warningsFunction · 0.90

Tested by

no test coverage detected