Test with both vanilla and eventlet stdlib

We intend this project's code to function both with and without
eventlet monkey patching, so we should test that way too.  This adds
a separate test run that explicitly enables eventlet and removes
the racy monkey patching that existed before.

I left the eventlet-specific unit test because it's making direct
calls into eventlet, so it is a somewhat different case from
implicitly using monkey patched classes and I'd rather leave a
redundant test than remove it and find out it covered something
the others don't.

Change-Id: Idbe9cdd90e9ce5e38b03ec1c20066928daa9ef00
Closes-Bug: 1367966
This commit is contained in:
Ben Nemec 2014-10-03 23:22:36 +00:00
parent ad4e21c83a
commit 8483811889
3 changed files with 21 additions and 1 deletions

View File

@ -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()

View File

@ -17,7 +17,6 @@ import shutil
import tempfile
import eventlet
eventlet.monkey_patch()
from eventlet import greenpool
from oslotest import base as test_base

View File

@ -14,8 +14,10 @@ setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
# We want to support both vanilla stdlib and eventlet monkey patched
commands =
lockutils-wrapper python setup.py testr --slowest --testr-args='{posargs}'
env TEST_EVENTLET=1 lockutils-wrapper python setup.py testr --slowest --testr-args='{posargs}'
[testenv:py33]
deps = -r{toxinidir}/requirements-py3.txt