summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-06-25 16:30:50 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-06-25 16:34:31 -0400
commite734e2befb7c2e796c24106f3236d010a62e6b9b (patch)
treed287a5f68ebaab7427ba5b5fc3e4cddd36e5955b
parentd7da57c87838fcb6449ed85d0989d139a596d6fa (diff)
downloadoslo-db-e734e2befb7c2e796c24106f3236d010a62e6b9b.tar.gz
Fix test to not assume eventlet isn't present
The test suite TpoolDbapiWrapperTestCase makes a blanket assumption that the test environment does not have eventlet installed; it places a mock object into sys.modules in order to take the place of eventlet. The test_db_api_without_installed_eventlet however deletes this mock, assuming that subsequent access will raise an ImportError. The change is to instead place None in this dictionary so that an ImportError is guaranteed regardless of whether or not eventlet is actually installed in the environment. Change-Id: I7b5b7c0d20581f8ecfa319f3cfa0f48112bc86b9 Closes-Bug: #1334427
-rw-r--r--tests/test_concurrency.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py
index cf34bba..a53ea80 100644
--- a/tests/test_concurrency.py
+++ b/tests/test_concurrency.py
@@ -103,6 +103,6 @@ class TpoolDbapiWrapperTestCase(test_utils.BaseTestCase):
# raise ImportError
self.conf.set_override('use_tpool', True, group='database')
- del sys.modules['eventlet']
+ sys.modules['eventlet'] = None
self.assertRaises(ImportError, getattr, self.db_api, 'fake')