changeset 52135:479899e53816

tests: hopefully fix `test-doctest.py` on Windows and more 1. Shell syntax understood by `shell=True` depends on the platform. Instead, pass `shell=False` and call `sh` explicitly to interpret the command correctly. 2. Stop setting `HGRCPATH=/dev/null`, so the setting `experimental.evolution=createmarkers` is set correctly. The reason I set HGRCPATH to /dev/null previously is because of misunderstanding where I thought the Python script had no HGRC to edit. As it turns out, there is in fact a valid temporary HGRC pointed to by HGRCPATH in this context so we don't seem to need this. /shrug
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Mon, 07 Oct 2024 12:08:48 +0100
parents f1312d0803a8
children cf8d029a480b
files tests/test-doctest.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-doctest.py	Sat Oct 26 13:56:46 2024 -0400
+++ b/tests/test-doctest.py	Mon Oct 07 12:08:48 2024 +0100
@@ -72,9 +72,13 @@
     sys.exit(0)
 
 files = subprocess.check_output(
-    "HGRCPATH=/dev/null . helpers-testrepo.sh; testrepohg files --print0 \"%s\""
-    % fileset,
-    shell=True,
+    [
+        "sh",
+        "-c",
+        "set -e; . helpers-testrepo.sh; testrepohg files --print0 \"%s\""
+        % fileset,
+    ],
+    shell=False,
     cwd=cwd,
 ).split(b'\0')