Allow ClientSession objects to get cleaned up by the garbage collector
Fixes #1652
This commit is contained in:
parent
1e35e60c21
commit
a552a248db
2 changed files with 20 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import absolute_import
|
||||
import mock
|
||||
import six
|
||||
import weakref
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
|
|
@ -227,3 +228,11 @@ class TestMultiCall(unittest.TestCase):
|
|||
self.assertEqual(2, self.ksession._sendCall.call_count)
|
||||
self.assertEqual([['a', 'b', 'c'],
|
||||
{'faultCode': 1000, 'faultString': 'msg'}], ret)
|
||||
|
||||
def test_MultiCallHack_weakref_validation(self):
|
||||
expected_exc = 'The session parameter must be a weak reference'
|
||||
with self.assertRaisesRegexp(TypeError, expected_exc):
|
||||
koji.MultiCallHack(self.ksession)
|
||||
|
||||
# This should not raise an exception
|
||||
koji.MultiCallHack(weakref.ref(self.ksession))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue