From 2a9321e65a7fc1ce7a2e7f5e5942b020412d9591 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Fri, 6 Feb 2015 17:32:39 +0000 Subject: [PATCH] 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 --- oslo_concurrency/tests/__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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()