Skip to content

Commit 6b691f5

Browse files
committed
close #7
1 parent e087067 commit 6b691f5

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
doublex (1.9.3-1) unstable; urgency=low
2+
3+
* New release
4+
5+
-- David Villa Alises <[email protected]> Tue, 15 Dec 2020 11:35:46 +0100
6+
17
doublex (1.9.2-1) unstable; urgency=low
28

39
* New release

doublex/proxy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ def get_call_args(self, context):
208208
args = (None,) + args # self
209209

210210
retval = getcallargs(self.method, *args, **context.kargs)
211-
del retval['self']
211+
if 'self' in retval:
212+
del retval['self']
212213
return retval
213214

214215
def assure_matches(self, context):

doublex/test/unit_tests.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,18 @@ def test_hack_function_spy(self):
17331733
# assert_that(stub("hello"), is_("world"))
17341734

17351735

1736+
# https://bitbucket.org/DavidVilla/python-doublex/issues/7/doublex-fails-on-methods-where-self-is
1737+
class capture_self(TestCase):
1738+
def test_capture_self(self):
1739+
class MyClass:
1740+
def my_method(*args):
1741+
pass
1742+
1743+
with Spy(MyClass) as spy:
1744+
spy.my_method('hello').returns(True)
1745+
1746+
1747+
17361748
class SomeException(Exception):
17371749
pass
17381750

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py26, py27, py33, py34, py35, py36, py37
2+
envlist = py26, py27, py33, py34, py35, py36, py37, py38, py39
33

44
[testenv]
55
deps=nose

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.9.2'
1+
__version__ = '1.9.3'

0 commit comments

Comments
 (0)