Author: Wim Lavrijsen <wlavrij...@lbl.gov> Branch: cppyy-packaging Changeset: r92084:5f12167c0f08 Date: 2017-08-04 21:10 -0700 http://bitbucket.org/pypy/pypy/changeset/5f12167c0f08/
Log: (re-)enable some more tests and add a collect cycle for consistency diff --git a/pypy/module/_cppyy/test/test_pythonify.py b/pypy/module/_cppyy/test/test_pythonify.py --- a/pypy/module/_cppyy/test/test_pythonify.py +++ b/pypy/module/_cppyy/test/test_pythonify.py @@ -68,18 +68,16 @@ """Test object and method calls.""" import _cppyy example01_class = _cppyy.gbl.example01 - #assert example01_class.getCount() == 0 + assert example01_class.getCount() == 0 instance = example01_class(7) - #assert example01_class.getCount() == 1 + assert example01_class.getCount() == 1 res = instance.addDataToInt(4) - return assert res == 11 res = instance.addDataToInt(-4) assert res == 3 instance.__destruct__() assert example01_class.getCount() == 0 raises(ReferenceError, 'instance.addDataToInt(4)') - return instance = example01_class(7) instance2 = example01_class(8) @@ -89,7 +87,6 @@ instance2.__destruct__() assert example01_class.getCount() == 0 - t = self.example01 instance = example01_class(13) res = instance.addDataToDouble(16) assert round(res-29, 8) == 0. @@ -97,10 +94,10 @@ instance = example01_class(-13) res = instance.addDataToDouble(16) assert round(res-3, 8) == 0. + instance.__destruct__() - - t = self.example01 instance = example01_class(42) + assert example01_class.getCount() == 1 res = instance.addDataToAtoi("13") assert res == 55 @@ -327,7 +324,9 @@ def test15_subclassing(self): """A sub-class on the python side should have that class as type""" - import _cppyy + import _cppyy, gc + gc.collect() + example01 = _cppyy.gbl.example01 assert example01.getCount() == 0 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit