diff options
author | Anthon van der Neut <anthon@mnt.org> | 2021-03-26 11:20:38 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2021-03-26 11:20:38 +0100 |
commit | 09f8576ae990234daebf51cca48b52d564f2c2d2 (patch) | |
tree | e08953ec5547d9ed05373a3134c3557f6ebf11c6 /_test/roundtrip.py | |
parent | e8719cd39655d98cf2bde1be15366cca7a58fd89 (diff) | |
download | ruamel.yaml-09f8576ae990234daebf51cca48b52d564f2c2d2.tar.gz |
remove support for 2.7, prepare for f-strings0.17.0
Diffstat (limited to '_test/roundtrip.py')
-rw-r--r-- | _test/roundtrip.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/_test/roundtrip.py b/_test/roundtrip.py index f8f4b21..8b87380 100644 --- a/_test/roundtrip.py +++ b/_test/roundtrip.py @@ -6,7 +6,7 @@ helper routines for testing round trip of commented YAML data import sys import textwrap import io -from ruamel.std.pathlib import Path +from pathlib import Path unset = object() @@ -46,7 +46,7 @@ def round_trip_load_all(inp, preserve_quotes=None, version=None): def round_trip_dump( data, - stream=None, *, + stream=None, # *, indent=None, block_seq_indent=None, default_flow_style=unset, @@ -79,7 +79,7 @@ def round_trip_dump( def round_trip_dump_all( data, - stream=None, *, + stream=None, # *, indent=None, block_seq_indent=None, default_flow_style=unset, @@ -326,12 +326,13 @@ def save_and_run(program, base_dir=None, output=None, file_name=None, optimized= file_name.write_text(dedent(program)) try: - cmd = [sys.executable] + cmd = [sys.executable, '-Wd'] if optimized: cmd.append('-O') cmd.append(str(file_name)) print('running:', *cmd) - res = check_output(cmd, stderr=STDOUT, universal_newlines=True) + # 3.5 needs strings + res = check_output(cmd, stderr=STDOUT, universal_newlines=True, cwd=str(base_dir)) if output is not None: if '__pypy__' in sys.builtin_module_names: res = res.splitlines(True) |