[test] ignore the user's hgrc
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 11 Jul 2014 14:40:31 +0200
changeset 1553 ba466ae29ba8
parent 1550 d77b516a8f00
child 1554 852401fe8b19
[test] ignore the user's hgrc Tests shouldn't depend on the user's own config.
test/test_functional.py
test/unittest_hooks.py
--- a/test/test_functional.py	Thu Jul 10 16:00:26 2014 +0200
+++ b/test/test_functional.py	Fri Jul 11 14:40:31 2014 +0200
@@ -1,3 +1,4 @@
+import os
 import os.path as osp
 import subprocess
 import shutil
@@ -13,13 +14,15 @@
 import narvalbot
 narvalbot._CW_SOURCES_FILE = osp.join(HERE, 'data', 'narval-cw-sources.ini')
 
+os.environ['HGRCPATH'] = os.devnull
+
 def setUpModule():
     ppath = osp.join(HERE, 'data', 'project')
     if osp.isdir(osp.join(ppath, '.hg')):
         shutil.rmtree(osp.join(ppath, '.hg'))
     subprocess.check_call(['hg', 'init', '-q', ppath])
     subprocess.check_call(['hg', 'addremove', '-q', '-R', ppath])
-    subprocess.check_call(['hg', 'commit', '-q', '-R', ppath, '-m', 'ze rev'])
+    subprocess.check_call(['hg', 'commit', '-q', '-R', ppath, '-m', 'ze rev', '-u', 'narval'])
     subprocess.check_call(['hg', 'phase', '-p', '.', '-q', '-R', ppath])
 
 def tearDownModule():
--- a/test/unittest_hooks.py	Thu Jul 10 16:00:26 2014 +0200
+++ b/test/unittest_hooks.py	Fri Jul 11 14:40:31 2014 +0200
@@ -11,6 +11,7 @@
 from cubes.apycot.hooks import start_period_tests
 from cubes.apycot.testutils import ApycotBaseTC
 
+os.environ['HGRCPATH'] = os.devnull
 
 def clean_str(string):
     url_filtered = re.sub('lgc/[0-9]*', 'lgc/<EID>', string.strip())
@@ -130,7 +131,7 @@
         os.system('hg init %s' % r.path)
         os.system('echo data > %s/tutu.png' % r.path)
         os.system('hg -R %s add %s/tutu.png' % (r.path, r.path))
-        os.system('hg -R %s commit -m rien' % r.path)
+        os.system('hg -R %s commit -m rien -u narval' % r.path)
         # reset vcsrepo
         with r.internal_session(safe=True) as session:
             bridge.import_content(session, commitevery=1, raise_on_error=True)
@@ -251,7 +252,7 @@
         os.system('echo data > %s/tutu1.png' % r.path)
         os.system('hg -R %s branch stable' % r.path)
         os.system('hg -R %s add %s/tutu1.png' % (r.path, r.path))
-        os.system('hg -R %s commit -m rien' % r.path)
+        os.system('hg -R %s commit -m rien -u narval' % r.path)
         with r.internal_session(safe=True) as session:
             bridge.import_content(session, commitevery=1, raise_on_error=True)
 
@@ -273,7 +274,7 @@
         self.assertEqual(0, os.system('echo data > %s/tutu2.png' % r.path))
         self.assertEqual(0,os.system('hg -R %s up default' % r.path))
         self.assertEqual(0,os.system('hg -R %s add %s/tutu2.png' % (r.path, r.path)))
-        self.assertEqual(0,os.system('hg -R %s commit -m rien' % r.path))
+        self.assertEqual(0,os.system('hg -R %s commit -m rien -u narval' % r.path))
         with r.internal_session(safe=True) as session:
             bridge.import_content(session, commitevery=1, raise_on_error=True)
         ## it should add te to the tc on default (lgc and lgc4)