Skip to content

Commit

Permalink
Merge branch 'fix-mock-tests' into 'master'
Browse files Browse the repository at this point in the history
Fix flake8 tests using mock to work with 1.1.x branch

See merge request !33
  • Loading branch information
sigmavirus24 committed Jul 10, 2015
2 parents b827629 + a4a4a48 commit d5c5feb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions flake8/tests/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_register_extensions(self):
self.assertTrue(len(registered_exts[0]) > 0)
for i in registered_exts[1:]:
self.assertTrue(isinstance(i, list))
register_check.assert_called()
self.assertTrue(register_check.called)

def test_get_parser(self):
# setup
Expand All @@ -67,13 +67,13 @@ def test_get_parser(self):
# actual call we're testing
parser, hooks = engine.get_parser()
# assertions
re.assert_called()
gpv.assert_called()
self.assertTrue(re.called)
self.assertTrue(gpv.called)
pgp.assert_called_once_with(
'flake8',
'%s (pyflakes: 0.7, mccabe: 0.2) Python Version' % __version__)
m.remove_option.assert_called()
m.add_option.assert_called()
self.assertTrue(m.remove_option.called)
self.assertTrue(m.add_option.called)
self.assertEqual(parser, m)
self.assertEqual(hooks, [])
# clean-up
Expand Down
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ envlist =
[testenv]
usedevelop = True
deps =
mock<1.1.0
mock
nose
commands =
python setup.py test -q
python setup.py flake8
nosetests flake8.tests._test_warnings

[testenv:py26]
deps =
mock==1.0.1
nose

[testenv:py27-flake8]
basepython = python2.7
deps =
Expand Down

0 comments on commit d5c5feb

Please sign in to comment.