summaryrefslogtreecommitdiff
path: root/tests/test_everything.py
diff options
context:
space:
mode:
authorMikhail Fludkov <fludkov.me@gmail.com>2018-02-06 15:24:17 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-02-08 09:11:11 +0100
commit024ac583538976330b429b9b203d412fec0426e3 (patch)
treee4f3bd4e216ec73ae4f5699e118466ce330b3ad5 /tests/test_everything.py
parentee79fef18748ad660d3a0471ed9a18ea11410849 (diff)
downloadpygobject-024ac583538976330b429b9b203d412fec0426e3.tar.gz
tests: test_boxed_c_wrapper failing tests
Introduced here 1ec8d58
Diffstat (limited to 'tests/test_everything.py')
-rw-r--r--tests/test_everything.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/test_everything.py b/tests/test_everything.py
index ac97e057..b7fcb2af 100644
--- a/tests/test_everything.py
+++ b/tests/test_everything.py
@@ -1129,6 +1129,37 @@ class TestBoxed(unittest.TestCase):
self.assertEqual(boxed, copy)
self.assertNotEqual(id(boxed), id(copy))
+ @unittest.expectedFailure
+ def test_boxed_c_wrapper(self):
+ wrapper = Everything.TestBoxedCWrapper()
+ obj = wrapper.get()
+
+ # TestBoxedC uses refcounting, so we know that
+ # it should be 2 at this point:
+ # - one owned by @wrapper
+ # - another owned by @obj
+ self.assertEqual(obj.refcount, 2)
+ del wrapper
+ self.assertEqual(obj.refcount, 1)
+
+ @unittest.expectedFailure
+ def test_boxed_c_wrapper_copy(self):
+ wrapper = Everything.TestBoxedCWrapper()
+ wrapper_copy = wrapper.copy()
+ obj = wrapper.get()
+
+ # TestBoxedC uses refcounting, so we know that
+ # it should be 3 at this point:
+ # - one owned by @wrapper
+ # - one owned by @wrapper_copy
+ # - another owned by @obj
+ self.assertEqual(obj.refcount, 3)
+ del wrapper
+ self.assertEqual(obj.refcount, 2)
+ del wrapper_copy
+ self.assertEqual(obj.refcount, 1)
+ del obj
+
class TestTortureProfile(unittest.TestCase):
def test_torture_profile(self):