From cbe68ba84c0291598d9060a73fa2d60549b4a85e Mon Sep 17 00:00:00 2001 From: sharkdp Date: Mon, 3 Aug 2020 15:10:26 +0200 Subject: [PATCH] Make sure that environment is properly set up --- tests/syntax-tests/create_highlighted_versions.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/syntax-tests/create_highlighted_versions.py b/tests/syntax-tests/create_highlighted_versions.py index 0b04d1aa..22849b7e 100755 --- a/tests/syntax-tests/create_highlighted_versions.py +++ b/tests/syntax-tests/create_highlighted_versions.py @@ -22,8 +22,17 @@ def create_highlighted_versions(output_basepath): for source in glob.glob(path.join(root, "source", "*", "*")): try: + env = os.environ.copy() + env.pop("PAGER", None) + env.pop("BAT_PAGER", None) + env.pop("BAT_CONFIG_PATH", None) + env.pop("BAT_STYLE", None) + env.pop("BAT_THEME", None) + env.pop("BAT_TABS", None) + env["COLORTERM"] = "truecolor" # make sure to output 24bit colors + bat_output = subprocess.check_output( - ["bat"] + BAT_OPTIONS + [source], stderr=subprocess.PIPE, + ["bat"] + BAT_OPTIONS + [source], stderr=subprocess.PIPE, env=env, ) source_dirname = path.basename(path.dirname(source))