diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-01-29 13:50:46 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-01-29 14:32:49 +0000 |
commit | e06eafcbf0784271f51c0936852d1e97c0ccce8b (patch) | |
tree | e7e914cd82348e79b7662e6bd06851a0100e7751 /morphlib/yamlparse_tests.py | |
parent | 63f608d7c05095c16d1a8863b13c55634c0cae8b (diff) | |
download | morph-e06eafcbf0784271f51c0936852d1e97c0ccce8b.tar.gz |
Make yaml be an optional dependency
This can go away when we have made a release with yaml in it, and its
staging filler.
Diffstat (limited to 'morphlib/yamlparse_tests.py')
-rw-r--r-- | morphlib/yamlparse_tests.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/morphlib/yamlparse_tests.py b/morphlib/yamlparse_tests.py index cb658e15..f5c2569b 100644 --- a/morphlib/yamlparse_tests.py +++ b/morphlib/yamlparse_tests.py @@ -15,17 +15,20 @@ import unittest -try: - from collections import OrderedDict -except ImportError: - from ordereddict import OrderedDict -import yaml - +import morphlib import morphlib.yamlparse as yamlparse +from morphlib.util import OrderedDict + +if morphlib.got_yaml: + yaml = morphlib.yaml class YAMLParseTests(unittest.TestCase): + def run(self, *args, **kwargs): + if morphlib.got_yaml: + return unittest.TestCase.run(self, *args, **kwargs) + example_text = '''\ name: foo kind: chunk |