mirror of https://github.com/OpenKMIP/PyKMIP.git
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:
parent
f86134878b
commit
7c6e45f549
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue