mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-08 05:54:17 +00:00
Slightly simplify our conditionals
Test warnings by default
This commit is contained in:
parent
59ae3dfec7
commit
a6fc242c5e
5 changed files with 18 additions and 13 deletions
|
|
@ -39,6 +39,7 @@ class TestEngine(unittest.TestCase):
|
|||
with mock.patch('flake8.engine.get_parser') as get_parser:
|
||||
m.ignored_extensions = []
|
||||
StyleGuide.return_value.options.jobs = '42'
|
||||
StyleGuide.return_value.options.diff = False
|
||||
get_parser.return_value = (m, [])
|
||||
engine.get_style_guide(foo='bar')
|
||||
get_parser.assert_called_once_with()
|
||||
|
|
@ -85,13 +86,13 @@ class TestEngine(unittest.TestCase):
|
|||
# ourselves) what system we may be testing on.
|
||||
|
||||
def test_windows_disables_jobs(self):
|
||||
with mock.patch('flake8.engine.is_windows') as is_windows:
|
||||
with mock.patch('flake8.util.is_windows') as is_windows:
|
||||
is_windows.return_value = True
|
||||
guide = engine.get_style_guide()
|
||||
assert isinstance(guide, reporter.BaseQReport) is False
|
||||
|
||||
def test_stdin_disables_jobs(self):
|
||||
with mock.patch('flake8.engine.is_using_stdin') as is_using_stdin:
|
||||
with mock.patch('flake8.util.is_using_stdin') as is_using_stdin:
|
||||
is_using_stdin.return_value = True
|
||||
guide = engine.get_style_guide()
|
||||
assert isinstance(guide, reporter.BaseQReport) is False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue