Files
glance/glance/tests/__init__.py
T
Hemanth Makkapati 630402204e Invoke Monkey Patching for All Tests
Eventlet 0.20.x adds support for monkey patching 'subprocess' and
drops 'select.poll'. So, when 'select' is patched and 'subproces'
is not, which is how Glance moneky patches for eventlet, following
errors show up.
"AttributeError: module 'select' has no attribute 'poll'".

Thus, to fix the errors I4de03e2a1ca493cd49a474a67cbbdec24d61b98f
attempted to green the tests to support eventlet 0.20.x.
However, that covered only functional tests causing other tests to
fail. This change monkey patches for eventlet right in 'glance.tests`
pacakge so that all tests are covered.

Closes-Bug: #1655727
Change-Id: Ice3d431ac0c8ece97471abced9ae2d5ad2be261d
2017-03-22 11:46:28 -05:00

32 lines
1.2 KiB
Python

# Copyright 2010-2011 OpenStack Foundation
# All Rights Reserved.
#
# 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.
# See http://code.google.com/p/python-nose/issues/detail?id=373
# The code below enables tests to work with i18n _() blocks
import six.moves.builtins as __builtin__
setattr(__builtin__, '_', lambda x: x)
# Set up logging to output debugging
import logging
logger = logging.getLogger()
hdlr = logging.FileHandler('run_tests.log', 'w')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.DEBUG)
import eventlet
eventlet.patcher.monkey_patch()