mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-09 06:14:17 +00:00
Update mock.patch to use pycodestyle as well
This commit is contained in:
parent
2cfc2777c1
commit
eac3fcfc42
4 changed files with 7 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
CHANGES
|
CHANGES
|
||||||
=======
|
=======
|
||||||
|
|
||||||
2.6.0 - 2016-06-xx
|
2.6.0 - 2016-06-15
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
- **Requirements Change** Switch to pycodestyle as all future pep8 releases
|
- **Requirements Change** Switch to pycodestyle as all future pep8 releases
|
||||||
|
|
@ -10,7 +10,7 @@ CHANGES
|
||||||
- **Improvement** Allow for Windows users on *select* versions of Python to
|
- **Improvement** Allow for Windows users on *select* versions of Python to
|
||||||
use ``--jobs`` and multiprocessing
|
use ``--jobs`` and multiprocessing
|
||||||
|
|
||||||
- **Improvement** Update bounds on McCabe (todo)
|
- **Improvement** Update bounds on McCabe
|
||||||
|
|
||||||
- **Improvement** Update bounds on PyFlakes and blacklist known broken
|
- **Improvement** Update bounds on PyFlakes and blacklist known broken
|
||||||
versions
|
versions
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ class IntegrationTestCaseWarnings(unittest.TestCase):
|
||||||
with open(self.this_file(), "r") as f:
|
with open(self.this_file(), "r") as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
with mock.patch("pep8.stdin_get_value", fake_stdin):
|
with mock.patch("pycodestyle.stdin_get_value", fake_stdin):
|
||||||
(style_guide,
|
(style_guide,
|
||||||
report,
|
report,
|
||||||
collected_warnings,
|
collected_warnings,
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ class TestEngine(unittest.TestCase):
|
||||||
StyleGuide.assert_called_once_with(**{'parser': m, 'foo': 'bar'})
|
StyleGuide.assert_called_once_with(**{'parser': m, 'foo': 'bar'})
|
||||||
|
|
||||||
def test_register_extensions(self):
|
def test_register_extensions(self):
|
||||||
with mock.patch('pep8.register_check') as register_check:
|
with mock.patch('pycodestyle.register_check') as register_check:
|
||||||
registered_exts = engine._register_extensions()
|
registered_exts = engine._register_extensions()
|
||||||
self.assertTrue(isinstance(registered_exts[0], util.OrderedSet))
|
self.assertTrue(isinstance(registered_exts[0], util.OrderedSet))
|
||||||
self.assertTrue(len(registered_exts[0]) > 0)
|
self.assertTrue(len(registered_exts[0]) > 0)
|
||||||
|
|
@ -72,7 +72,7 @@ class TestEngine(unittest.TestCase):
|
||||||
# setup
|
# setup
|
||||||
re = self.start_patch('flake8.engine._register_extensions')
|
re = self.start_patch('flake8.engine._register_extensions')
|
||||||
gpv = self.start_patch('flake8.engine.get_python_version')
|
gpv = self.start_patch('flake8.engine.get_python_version')
|
||||||
pgp = self.start_patch('pep8.get_parser')
|
pgp = self.start_patch('pycodestyle.get_parser')
|
||||||
m = mock.Mock()
|
m = mock.Mock()
|
||||||
re.return_value = ([('pyflakes', '0.7'), ('mccabe', '0.2')], [], [],
|
re.return_value = ([('pyflakes', '0.7'), ('mccabe', '0.2')], [], [],
|
||||||
[])
|
[])
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ class IntegrationTestCase(unittest.TestCase):
|
||||||
with open(self.this_file(), "r") as f:
|
with open(self.this_file(), "r") as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
with mock.patch("pep8.stdin_get_value", fake_stdin):
|
with mock.patch("pycodestyle.stdin_get_value", fake_stdin):
|
||||||
guide, report = self.check_files(arglist=['--jobs=4'],
|
guide, report = self.check_files(arglist=['--jobs=4'],
|
||||||
explicit_stdin=True)
|
explicit_stdin=True)
|
||||||
self.assertEqual(self.count, 1)
|
self.assertEqual(self.count, 1)
|
||||||
|
|
@ -72,7 +72,7 @@ class IntegrationTestCase(unittest.TestCase):
|
||||||
def test_stdin_fail(self):
|
def test_stdin_fail(self):
|
||||||
def fake_stdin():
|
def fake_stdin():
|
||||||
return "notathing\n"
|
return "notathing\n"
|
||||||
with mock.patch("pep8.stdin_get_value", fake_stdin):
|
with mock.patch("pycodestyle.stdin_get_value", fake_stdin):
|
||||||
# only assert needed is in check_files
|
# only assert needed is in check_files
|
||||||
guide, report = self.check_files(arglist=['--jobs=4'],
|
guide, report = self.check_files(arglist=['--jobs=4'],
|
||||||
explicit_stdin=True,
|
explicit_stdin=True,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue