[Updated] D9150: tests: skip doctests if not running from a hg repo

joerg.sonnenberger (Joerg Sonnenberger) phabricator at mercurial-scm.org
Mon Oct 5 22:09:19 UTC 2020


Closed by commit rHG5a19d7c9129b: tests: skip doctests if not running from a hg repo (authored by joerg.sonnenberger).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D9150?vs=23037&id=23038

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D9150/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D9150

AFFECTED FILES
  tests/test-doctest.py

CHANGE DETAILS

diff --git a/tests/test-doctest.py b/tests/test-doctest.py
--- a/tests/test-doctest.py
+++ b/tests/test-doctest.py
@@ -4,7 +4,7 @@
 from __future__ import print_function
 
 import doctest
-import os
+import os.path
 import re
 import subprocess
 import sys
@@ -72,6 +72,9 @@
 
 cwd = os.path.dirname(os.environ["TESTDIR"])
 
+if not os.path.isdir(os.path.join(cwd, ".hg")):
+    sys.exit(0)
+
 files = subprocess.check_output(
     "hg files --print0 \"%s\"" % fileset, shell=True, cwd=cwd,
 ).split(b'\0')



To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20201005/e50bf207/attachment-0002.html>


More information about the Mercurial-patches mailing list