# HG changeset patch # User Joerg Sonnenberger # Date 1601903295 -7200 # Node ID 5a19d7c9129b100e094e44b68d492d9548cb3d17 # Parent a36cb826b1bbb2c6c42f5fd63ae58a8862c00d3b tests: skip doctests if not running from a hg repo Differential Revision: https://phab.mercurial-scm.org/D9150 diff -r a36cb826b1bb -r 5a19d7c9129b tests/test-doctest.py --- a/tests/test-doctest.py Fri Oct 02 19:19:01 2020 +0530 +++ b/tests/test-doctest.py Mon Oct 05 15:08:15 2020 +0200 @@ -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')