Files
sqlalchemy/test/base/test_examples.py
Mike Bayer 24dd3d8c90 support DeclarativeBase for versioned history example
Fixed issue in "versioned history" example where using a declarative base
that is derived from :class:`_orm.DeclarativeBase` would fail to be mapped.
Additionally, repaired the given test suite so that the documented
instructions for running the example using Python unittest now work again.

Change-Id: I164a5b8dbdd01e3d815eb356f7b7cadf226ca296
References: #9546
2023-03-27 09:55:57 -04:00

32 lines
602 B
Python

import os
import sys
from sqlalchemy.testing import fixtures
here = os.path.dirname(__file__)
sqla_base = os.path.normpath(os.path.join(here, "..", ".."))
sys.path.insert(0, sqla_base)
test_versioning = __import__(
"examples.versioned_history.test_versioning"
).versioned_history.test_versioning
class VersionedRowsTestLegacyBase(
test_versioning.TestVersioning,
fixtures.RemoveORMEventsGlobally,
fixtures.TestBase,
):
pass
class VersionedRowsTestNewBase(
test_versioning.TestVersioningNewBase,
fixtures.RemoveORMEventsGlobally,
fixtures.TestBase,
):
pass