]> git.pld-linux.org Git - packages/python-sure.git/blob - python-sure-mock.patch
- updated to 2.0.0
[packages/python-sure.git] / python-sure-mock.patch
1 --- sure-2.0.0/setup.py.orig    2018-05-16 23:37:56.000000000 +0200
2 +++ sure-2.0.0/setup.py 2020-06-06 07:54:38.467908573 +0200
3 @@ -81,7 +81,7 @@
4          return __doc__
5  
6  
7 -install_requires = ["mock", "six"]
8 +install_requires = ['mock;python_version<"3"', "six"]
9  tests_require = ["nose"]
10  version = read_version()
11  
12 --- sure-1.4.11/sure/core.py.orig       2018-03-17 23:31:48.000000000 +0100
13 +++ sure-1.4.11/sure/core.py    2020-06-06 07:56:27.183986275 +0200
14 @@ -19,9 +19,12 @@
15  import os
16  
17  try:
18 -    from mock import _CallList
19 +    from unittest.mock import _CallList
20  except ImportError:
21 -    from mock.mock import _CallList
22 +    try:
23 +        from mock import _CallList
24 +    except ImportError:
25 +        from mock.mock import _CallList
26  
27  import inspect
28  from six import (
29 --- sure-1.4.11/tests/test_assertion_builder.py.orig    2017-03-20 14:51:42.000000000 +0100
30 +++ sure-1.4.11/tests/test_assertion_builder.py 2020-06-06 07:58:55.016518731 +0200
31 @@ -17,7 +17,10 @@
32  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
33  from __future__ import unicode_literals
34  import re
35 -import mock
36 +try:
37 +    from unittest import mock
38 +except ImportError:
39 +    import mock
40  from collections import OrderedDict
41  
42  from datetime import datetime, timedelta
43 @@ -654,18 +654,18 @@
44  
45      except AssertionError as e:
46          if PY2:
47 -            expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 635]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
48 +            expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 638]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
49          else:
50 -            expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 635]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
51 +            expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 638]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
52  
53      try:
54          expect(blah).when.called_with(1).should.throw(ValueError, re.compile(r'invalid regex'))
55          raise RuntimeError('should not have reached here')
56      except AssertionError as e:
57          if PY2:
58 -            expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 635]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
59 +            expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 638]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
60          else:
61 -            expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 635]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
62 +            expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 638]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
63  
64  def test_should_not_be_different():
65      ("'something'.should_not.be.different('SOMETHING'.lower())")
This page took 0.099417 seconds and 3 git commands to generate.