on master help sign in
Make sure that environment is properly set up
commitcbe68ba84c0291598d9060a73fa2d60549b4a85e authorsharkdp <davidpeter@web.de> dateMon 3 Aug 2020, 15:10 (6 years ago) parent9110b00
1 file changed+10−1
tests/syntax-tests/create_highlighted_versions.py+10−1
tests/syntax-tests/create_highlighted_versions.py+10−1
@@ -22,8 +22,17 @@ def create_highlighted_versions(output_basepath):
2222
2323 for source in glob.glob(path.join(root, "source", "*", "*")):
2424 try:
25+ env = os.environ.copy()
26+ env.pop("PAGER", None)
27+ env.pop("BAT_PAGER", None)
28+ env.pop("BAT_CONFIG_PATH", None)
29+ env.pop("BAT_STYLE", None)
30+ env.pop("BAT_THEME", None)
31+ env.pop("BAT_TABS", None)
32+ env["COLORTERM"] = "truecolor" # make sure to output 24bit colors
33+
2534 bat_output = subprocess.check_output(
26− ["bat"] + BAT_OPTIONS + [source], stderr=subprocess.PIPE,
35+ ["bat"] + BAT_OPTIONS + [source], stderr=subprocess.PIPE, env=env,
2736 )
2837
2938 source_dirname = path.basename(path.dirname(source))