Merge "Update hacking version"

This commit is contained in:
Zuul 2019-03-25 09:10:07 +00:00 committed by Gerrit Code Review
commit 9a99cd6812
4 changed files with 13 additions and 13 deletions

View File

@ -10,9 +10,9 @@ eventlet==0.18.2
extras==1.0.0 extras==1.0.0
fasteners==0.7.0 fasteners==0.7.0
fixtures==3.0.0 fixtures==3.0.0
flake8==2.5.5 flake8==2.6.0
greenlet==0.4.10 greenlet==0.4.10
hacking==0.12.0 hacking==1.1.0
imagesize==0.7.1 imagesize==0.7.1
iso8601==0.1.11 iso8601==0.1.11
Jinja2==2.10 Jinja2==2.10

View File

@ -18,7 +18,7 @@ import os
import textwrap import textwrap
import mock import mock
import pep8 import pycodestyle
from os_win._hacking import checks from os_win._hacking import checks
from os_win.tests.unit import test_base from os_win.tests.unit import test_base
@ -58,20 +58,20 @@ class HackingTestCase(test_base.OsWinBaseTestCase):
""" """
def _run_check(self, code, checker, filename=None): def _run_check(self, code, checker, filename=None):
# We are patching pep8 so that only the check under test is actually # We are patching pycodestyle (pep8) so that only the check under test
# installed. # is actually installed.
mock_checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}} mock_checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}}
with mock.patch('pep8._checks', mock_checks): with mock.patch('pycodestyle._checks', mock_checks):
pep8.register_check(checker) pycodestyle.register_check(checker)
lines = textwrap.dedent(code).strip().splitlines(True) lines = textwrap.dedent(code).strip().splitlines(True)
checker = pep8.Checker(filename=filename, lines=lines) checker = pycodestyle.Checker(filename=filename, lines=lines)
# NOTE(sdague): the standard reporter has printing to stdout # NOTE(sdague): the standard reporter has printing to stdout
# as a normal part of check_all, which bleeds through to the # as a normal part of check_all, which bleeds through to the
# test output stream in an unhelpful way. This blocks that # test output stream in an unhelpful way. This blocks that
# printing. # printing.
with mock.patch('pep8.StandardReport.get_file_results'): with mock.patch('pycodestyle.StandardReport.get_file_results'):
checker.check_all() checker.check_all()
checker.report._deferred_print.sort() checker.report._deferred_print.sort()
return checker.report._deferred_print return checker.report._deferred_print

View File

@ -23,12 +23,12 @@ import sys
import threading import threading
import time import time
if sys.platform == 'win32':
import wmi
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import reflection from oslo_utils import reflection
if sys.platform == 'win32':
import wmi
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -2,7 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 hacking>=1.1.0,<1.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT ddt>=1.0.1 # MIT