From 8c3858b01623f9527b57b13c44ff97c67bafb00b Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 19 Jan 2014 18:41:55 +0200 Subject: Move tests in basic/tests/ up one level preparating to multiple test dirs. --- tests/basics/class_inherit1.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/basics/class_inherit1.py (limited to 'tests/basics/class_inherit1.py') diff --git a/tests/basics/class_inherit1.py b/tests/basics/class_inherit1.py new file mode 100644 index 000000000..9ca2d9f14 --- /dev/null +++ b/tests/basics/class_inherit1.py @@ -0,0 +1,21 @@ +class A: + def __init__(self, x): + print('A init', x) + self.x = x + + def f(self): + print(self.x, self.y) + +class B(A): + def __init__(self, x, y): + A.__init__(self, x) + print('B init', x, y) + self.y = y + + def g(self): + print(self.x, self.y) + +A(1) +b = B(1, 2) +b.f() +b.g() -- cgit v1.2.3