diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2018-03-31 14:39:48 +0200 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-03-31 14:39:48 +0200 |
commit | 743f530e2a1258d3a940eae51eaf0e7fa2289dce (patch) | |
tree | 380d22a6b509c892070e1caa608502c3e2eb52d0 /tests/test_gi.py | |
parent | 809f116a9739f77ea98b8ee11f102b44e38ee710 (diff) | |
download | pygobject-743f530e2a1258d3a940eae51eaf0e7fa2289dce.tar.gz |
tests: Skip various sys.getrefcount() checks in case sys.getrefcount is missing
PyPy doesn't support it.
Diffstat (limited to 'tests/test_gi.py')
-rw-r--r-- | tests/test_gi.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_gi.py b/tests/test_gi.py index 91f4ffc7..24d94b20 100644 --- a/tests/test_gi.py +++ b/tests/test_gi.py @@ -1651,6 +1651,7 @@ class TestGValue(unittest.TestCase): gc.collect() self.assertEqual(ref(), None) + @unittest.skipUnless(hasattr(sys, "getrefcount"), "no sys.getrefcount") def test_gvalue_boxed_ref_counts(self): # Tests a boxed type wrapping a python object pointer (TYPE_PYOBJECT) # held by a GValue @@ -2542,6 +2543,7 @@ class TestPythonGObject(unittest.TestCase): object_.method_with_default_implementation(84) self.assertEqual(object_.props.int, 84) + @unittest.skipUnless(hasattr(sys, "getrefcount"), "no sys.getrefcount") def test_vfunc_return_ref_count(self): obj = self.Object(int=42) ref_count = sys.getrefcount(obj.return_for_caller_allocated_out_parameter) @@ -2555,6 +2557,12 @@ class TestPythonGObject(unittest.TestCase): self.assertEqual(sys.getrefcount(obj.return_for_caller_allocated_out_parameter), ref_count) + def test_vfunc_return_no_ref_count(self): + obj = self.Object(int=42) + ret = obj.vfunc_caller_allocated_out_parameter() + self.assertEqual(ret, obj.return_for_caller_allocated_out_parameter) + self.assertFalse(ret is obj.return_for_caller_allocated_out_parameter) + def test_subobject_parent_vfunc(self): object_ = self.SubObject(int=81) object_.method_with_default_implementation(87) |