mirror of
https://github.com/openkmip/pykmip
synced 2025-12-10 13:23:15 +00:00
Fix bug generating detached instance errors in server tests
This patch fixes a bug that generates intermittent sqlalchemy DetachedInstanceErrors during the KMIP server engine unit test execution. Specifically, this fix disables instance expiration on commit for the sqlalchemy sessions used throughout the unit tests, allowing access to instance attributes even if the instance is detached from a session. Fixes #312
This commit is contained in:
@@ -83,7 +83,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||
)
|
||||
sqltypes.Base.metadata.create_all(self.engine)
|
||||
self.session_factory = sqlalchemy.orm.sessionmaker(
|
||||
bind=self.engine
|
||||
bind=self.engine,
|
||||
expire_on_commit=False
|
||||
)
|
||||
|
||||
self.temp_dir = tempfile.mkdtemp()
|
||||
|
||||
Reference in New Issue
Block a user