Merge "Update hacking version"
This commit is contained in:
commit
9a99cd6812
@ -10,9 +10,9 @@ eventlet==0.18.2
|
||||
extras==1.0.0
|
||||
fasteners==0.7.0
|
||||
fixtures==3.0.0
|
||||
flake8==2.5.5
|
||||
flake8==2.6.0
|
||||
greenlet==0.4.10
|
||||
hacking==0.12.0
|
||||
hacking==1.1.0
|
||||
imagesize==0.7.1
|
||||
iso8601==0.1.11
|
||||
Jinja2==2.10
|
||||
|
@ -18,7 +18,7 @@ import os
|
||||
import textwrap
|
||||
|
||||
import mock
|
||||
import pep8
|
||||
import pycodestyle
|
||||
|
||||
from os_win._hacking import checks
|
||||
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):
|
||||
# We are patching pep8 so that only the check under test is actually
|
||||
# installed.
|
||||
# We are patching pycodestyle (pep8) so that only the check under test
|
||||
# is actually installed.
|
||||
mock_checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}}
|
||||
with mock.patch('pep8._checks', mock_checks):
|
||||
pep8.register_check(checker)
|
||||
with mock.patch('pycodestyle._checks', mock_checks):
|
||||
pycodestyle.register_check(checker)
|
||||
|
||||
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
|
||||
# as a normal part of check_all, which bleeds through to the
|
||||
# test output stream in an unhelpful way. This blocks that
|
||||
# printing.
|
||||
with mock.patch('pep8.StandardReport.get_file_results'):
|
||||
with mock.patch('pycodestyle.StandardReport.get_file_results'):
|
||||
checker.check_all()
|
||||
checker.report._deferred_print.sort()
|
||||
return checker.report._deferred_print
|
||||
|
@ -23,12 +23,12 @@ import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
if sys.platform == 'win32':
|
||||
import wmi
|
||||
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import reflection
|
||||
|
||||
if sys.platform == 'win32':
|
||||
import wmi
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# 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
|
||||
ddt>=1.0.1 # MIT
|
||||
|
Loading…
Reference in New Issue
Block a user