diff --git a/flake8-fix-tests-using-new-mock.patch b/flake8-fix-tests-using-new-mock.patch new file mode 100644 index 0000000..52f0660 --- /dev/null +++ b/flake8-fix-tests-using-new-mock.patch @@ -0,0 +1,34 @@ +From b0f30f97fbec04c1ab7cb8937f636822eab63885 Mon Sep 17 00:00:00 2001 +From: Ian Cordasco +Date: Fri, 10 Jul 2015 09:34:49 -0500 +Subject: [PATCH] Fix flake8 tests using mock to work with 1.1.x branch + +--- a/flake8/tests/test_engine.py ++++ b/flake8/tests/test_engine.py +@@ -51,7 +51,7 @@ class TestEngine(unittest.TestCase): + 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 +@@ -66,13 +66,13 @@ class TestEngine(unittest.TestCase): + # 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 diff --git a/python-flake8.changes b/python-flake8.changes index 807502f..3987eaf 100644 --- a/python-flake8.changes +++ b/python-flake8.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 10 08:45:26 UTC 2015 - mlin@suse.com + +- Add upstream patch flake8-fix-tests-using-new-mock.patch + * Fix tests using mock 1.1.x and above + ------------------------------------------------------------------- Thu Feb 26 20:32:07 UTC 2015 - tbechtold@suse.com diff --git a/python-flake8.spec b/python-flake8.spec index ab5ab77..8eadab5 100644 --- a/python-flake8.spec +++ b/python-flake8.spec @@ -24,6 +24,8 @@ License: MIT Group: Development/Languages/Python Url: http://bitbucket.org/tarek/flake8 Source: http://pypi.python.org/packages/source/f/flake8/flake8-%{version}.tar.gz +# PATCH-FIX-UPSTREAM flake8-fix-tests-using-new-mock.patch -- mlin@suse.com +Patch1: flake8-fix-tests-using-new-mock.patch BuildRequires: python-devel BuildRequires: python-setuptools # Test requirements: @@ -53,6 +55,7 @@ Flake8 runs all the tools by launching the single ``flake8`` script. %prep %setup -q -n flake8-%{version} +%patch1 -p1 %build python setup.py build