forked from pool/python-flake8
Accepting request 322369 from devel:languages:python
1 OBS-URL: https://build.opensuse.org/request/show/322369 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-flake8?expand=0&rev=11
This commit is contained in:
commit
5620f7c2be
34
flake8-fix-tests-using-new-mock.patch
Normal file
34
flake8-fix-tests-using-new-mock.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
From b0f30f97fbec04c1ab7cb8937f636822eab63885 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ian Cordasco <graffatcolmingov@gmail.com>
|
||||||
|
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
|
@ -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
|
Thu Feb 26 20:32:07 UTC 2015 - tbechtold@suse.com
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ License: MIT
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
Url: http://bitbucket.org/tarek/flake8
|
Url: http://bitbucket.org/tarek/flake8
|
||||||
Source: http://pypi.python.org/packages/source/f/flake8/flake8-%{version}.tar.gz
|
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-devel
|
||||||
BuildRequires: python-setuptools
|
BuildRequires: python-setuptools
|
||||||
# Test requirements:
|
# Test requirements:
|
||||||
@ -53,6 +55,7 @@ Flake8 runs all the tools by launching the single ``flake8`` script.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n flake8-%{version}
|
%setup -q -n flake8-%{version}
|
||||||
|
%patch1 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
python setup.py build
|
python setup.py build
|
||||||
|
Loading…
Reference in New Issue
Block a user