Skip to content

[WIP] Drop tp_call implementation from metatype #496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve test.
  • Loading branch information
filmor committed Jun 16, 2017
commit 0dda85ac5ae73ac4f9987d30bba55af84f426224
14 changes: 5 additions & 9 deletions src/tests/test_subclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,15 @@ def test_isinstance_check():
assert isinstance(x, System.String)


_derived_cons_calls = 0

def test_derived_constructor_only_called_once():
global _derived_cons_calls
_derived_cons_calls = 0
calls = []

class X(System.Object):
__namespace__ = "PyTest"

def __init__(self):
global _derived_cons_calls
_derived_cons_calls += 1
def __init__(self, *args):
calls.append(args)

x = X()
x = X(1, 2)

assert _derived_cons_calls == 1
assert calls == [(1, 2)]