summaryrefslogtreecommitdiff
path: root/python/tests/codec.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests/codec.py')
-rw-r--r--python/tests/codec.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/python/tests/codec.py b/python/tests/codec.py
index f9f7aab918..fbaf05fc20 100644
--- a/python/tests/codec.py
+++ b/python/tests/codec.py
@@ -54,7 +54,13 @@ __doc__ = """
"""
-SPEC = load(testrunner.get_spec_file("amqp.0-10-preview.xml"))
+SPEC = None
+
+def spec():
+ global SPEC
+ if SPEC == None:
+ SPEC = load(testrunner.get_spec_file("amqp.0-10-preview.xml"))
+ return SPEC
# --------------------------------------
# --------------------------------------
@@ -70,7 +76,7 @@ class BaseDataTypes(unittest.TestCase):
"""
standard setUp for unitetest (refer unittest documentation for details)
"""
- self.codec = Codec(StringIO(), SPEC)
+ self.codec = Codec(StringIO(), spec())
# ------------------
def tearDown(self):
@@ -508,7 +514,7 @@ def test(type, value):
else:
values = [value]
stream = StringIO()
- codec = Codec(stream, SPEC)
+ codec = Codec(stream, spec())
for v in values:
codec.encode(type, v)
codec.flush()