changeset 51962:7b8769cca23d stable

doctest: use the system hg to find the list of file to tests Same as what we do for the `.t` tests, but more manually.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 08 Oct 2024 20:50:46 +0200
parents a9b1acca2b14
children 5e2f0fec0a47 141ed0bf72a1
files tests/test-doctest.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-doctest.py	Tue Oct 08 15:54:59 2024 +0200
+++ b/tests/test-doctest.py	Tue Oct 08 20:50:46 2024 +0200
@@ -69,8 +69,13 @@
 if not os.path.isdir(os.path.join(cwd, ".hg")):
     sys.exit(0)
 
+files_cmd = "hg files --print0 \"%s\"" % fileset
+
+if 'HGTEST_RESTOREENV' in os.environ:
+    files_cmd = '. $HGTEST_RESTOREENV; ' + files_cmd
+
 files = subprocess.check_output(
-    "hg files --print0 \"%s\"" % fileset,
+    files_cmd,
     shell=True,
     cwd=cwd,
 ).split(b'\0')