diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-08-30 21:33:42 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-08-30 21:33:42 +0300 |
commit | 35be9e805fcdc1e0d541b64b62e381fa0b490812 (patch) | |
tree | 0164126e7bc2fbb009b3e5e4939f9f73051ec386 /tests/basics/class_new.py | |
parent | b565c36963178817fedec4971c6719ea96987c71 (diff) |
tests/class_new: Add checks for __init__ being called and other improvements.
Diffstat (limited to 'tests/basics/class_new.py')
-rw-r--r-- | tests/basics/class_new.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/basics/class_new.py b/tests/basics/class_new.py index 9a7072ad0..4912f71f0 100644 --- a/tests/basics/class_new.py +++ b/tests/basics/class_new.py @@ -5,13 +5,14 @@ try: except AttributeError: print("SKIP") raise SystemExit + class A: def __new__(cls): print("A.__new__") return super(cls, A).__new__(cls) def __init__(self): - pass + print("A.__init__") def meth(self): print('A.meth') @@ -35,5 +36,10 @@ a.meth() class B: def __new__(self, v1, v2): - None -B(1, 2) + print("B.__new__", v1, v2) + + def __init__(self, v1, v2): + # Should not be called in this test + print("B.__init__", v1, v2) + +print("B inst:", B(1, 2)) |