[PATCH 3 of 5] run-tests: do not copy sitecustomize.py

Simon Heimberg simohe at besonet.ch
Tue Feb 8 00:56:01 CST 2011


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1297146034 -3600
# Node ID 0e69d61fd334c37bbe5dd20107335da8ee0107d2
# Parent  602524d1741a06207dc228079789b4cfac7266be
run-tests: do not copy sitecustomize.py

because testdir is in PYTHONPATH, no copying of sitecustomize is necessary

diff -r 602524d1741a -r 0e69d61fd334 tests/run-tests.py
--- a/tests/run-tests.py	Mit Feb 02 23:21:13 2011 +0100
+++ b/tests/run-tests.py	Die Feb 08 07:20:34 2011 +0100
@@ -405,15 +405,15 @@
         f.close()
 
     if options.anycoverage:
-        custom = os.path.join(TESTDIR, 'sitecustomize.py')
-        target = os.path.join(PYTHONDIR, 'sitecustomize.py')
-        vlog('# Installing coverage trigger to %s' % target)
-        shutil.copyfile(custom, target)
+        # testdir is in PYTHONPATH, no copying of sitecustomize is necessary
         rc = os.path.join(TESTDIR, '.coveragerc')
         vlog('# Installing coverage rc to %s' % rc)
+        # setting this variable enables coverage
         os.environ['COVERAGE_PROCESS_START'] = rc
         fn = os.path.join(INST, '..', '.coverage')
         os.environ['COVERAGE_FILE'] = fn
+    else:
+        os.environ.pop('COVERAGE_PROCESS_START', None)
 
 def outputcoverage(options):
 


More information about the Mercurial-devel mailing list