summaryrefslogtreecommitdiff
path: root/tests/test_source.py
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:42:21 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:42:25 +0900
commit70d11d3c9704b35313f8b4dfbb3bc1c1c4afd87d (patch)
tree11933300cf1858b15462f508825db2d7607af1c8 /tests/test_source.py
parent7db802a3275790915ed33b470f58786a362551c6 (diff)
downloadpygobject2-70d11d3c9704b35313f8b4dfbb3bc1c1c4afd87d.tar.gz
pygobject2-70d11d3c9704b35313f8b4dfbb3bc1c1c4afd87d.tar.bz2
pygobject2-70d11d3c9704b35313f8b4dfbb3bc1c1c4afd87d.zip
Imported Upstream version 3.13.90
Change-Id: I048554219111ec0298380f936df392f24036bfd3 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'tests/test_source.py')
-rw-r--r--tests/test_source.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/test_source.py b/tests/test_source.py
index e0910f9..4c8bcc5 100644
--- a/tests/test_source.py
+++ b/tests/test_source.py
@@ -1,5 +1,6 @@
# -*- Mode: Python -*-
+import gc
import unittest
import warnings
@@ -123,6 +124,7 @@ class TestSource(unittest.TestCase):
return s
s = f()
+ gc.collect()
self.assertTrue(s.is_destroyed())
def test_remove(self):
@@ -205,8 +207,9 @@ class TestSource(unittest.TestCase):
self.finalized = True
source = S()
- id = source.attach()
- print('source id:', id)
+ self.assertEqual(source.ref_count, 1)
+ source.attach()
+ self.assertEqual(source.ref_count, 2)
self.assertFalse(self.finalized)
self.assertFalse(source.is_destroyed())
@@ -214,6 +217,7 @@ class TestSource(unittest.TestCase):
pass
source.destroy()
+ self.assertEqual(source.ref_count, 1)
self.assertTrue(self.dispatched)
self.assertFalse(self.finalized)
self.assertTrue(source.is_destroyed())