summaryrefslogtreecommitdiff
path: root/_test/lib/test_representer.py
diff options
context:
space:
mode:
Diffstat (limited to '_test/lib/test_representer.py')
-rw-r--r--_test/lib/test_representer.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/_test/lib/test_representer.py b/_test/lib/test_representer.py
index 2c7e2c8..a83d2b2 100644
--- a/_test/lib/test_representer.py
+++ b/_test/lib/test_representer.py
@@ -14,8 +14,12 @@ def test_representer_types(code_filename, verbose=False):
native1 = test_constructor._load_code(fp0.read())
native2 = None
try:
- output = yaml.dump(native1, Dumper=test_constructor.MyDumper,
- allow_unicode=allow_unicode, encoding=encoding)
+ output = yaml.dump(
+ native1,
+ Dumper=test_constructor.MyDumper,
+ allow_unicode=allow_unicode,
+ encoding=encoding,
+ )
native2 = yaml.load(output, Loader=test_constructor.MyLoader)
try:
if native1 == native2:
@@ -25,18 +29,18 @@ def test_representer_types(code_filename, verbose=False):
value1 = test_constructor._serialize_value(native1)
value2 = test_constructor._serialize_value(native2)
if verbose:
- print("SERIALIZED NATIVE1:")
+ print('SERIALIZED NATIVE1:')
print(value1)
- print("SERIALIZED NATIVE2:")
+ print('SERIALIZED NATIVE2:')
print(value2)
assert value1 == value2, (native1, native2)
finally:
if verbose:
- print("NATIVE1:")
+ print('NATIVE1:')
pprint.pprint(native1)
- print("NATIVE2:")
+ print('NATIVE2:')
pprint.pprint(native2)
- print("OUTPUT:")
+ print('OUTPUT:')
print(output)
@@ -44,4 +48,5 @@ test_representer_types.unittest = ['.code']
if __name__ == '__main__':
import test_appliance
+
test_appliance.run(globals())