summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Nemec <bnemec@redhat.com>2015-02-06 17:32:39 +0000
committerBen Nemec <bnemec@redhat.com>2015-02-06 17:32:39 +0000
commit2a9321e65a7fc1ce7a2e7f5e5942b020412d9591 (patch)
tree6d8fa1324c12731e8025d36519ffc23c8ca7e89e
parent67181a8610b699d3cb6a6e1c9b567271e80ce1ec (diff)
downloadoslo-concurrency-2a9321e65a7fc1ce7a2e7f5e5942b020412d9591.tar.gz
Add eventlet test check to new tests __init__.py
This is used to allow us to test both with and without eventlet. It wasn't copied to the new tests directory in the namespace move, which means that once the old tests go away eventlet won't be monkey patching even when we try to make it. Also, there's a race depending on whether the top-level tests are run first, or the new package ones. Change-Id: Ie2705c3d21625e594471f27eefc3ac3147390cb7
-rw-r--r--oslo_concurrency/tests/__init__.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/oslo_concurrency/tests/__init__.py b/oslo_concurrency/tests/__init__.py
index e69de29..bd455c4 100644
--- a/oslo_concurrency/tests/__init__.py
+++ b/oslo_concurrency/tests/__init__.py
@@ -0,0 +1,19 @@
+# Copyright 2014 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import os
+
+if os.environ.get('TEST_EVENTLET'):
+ import eventlet
+ eventlet.monkey_patch()