summaryrefslogtreecommitdiff
path: root/distutils2/tests
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-02-12 00:02:26 +0000
committerAlexis Metaireau <alexis@notmyidea.org>2011-02-12 00:02:26 +0000
commit559875c11f61d67374aa5a1b6e7fcc6dab36bf3f (patch)
tree47a4b3fcaa48d8981877e8550b228e8257494c99 /distutils2/tests
parentb9530dba94fbf8d5bf88f198f6b7eea090c8eb54 (diff)
downloaddisutils2-559875c11f61d67374aa5a1b6e7fcc6dab36bf3f.tar.gz
Mock sysconfig.get_paths in the mkcfg tests, in order to have the same output in everywhere.
Diffstat (limited to 'distutils2/tests')
-rw-r--r--distutils2/tests/test_mkcfg.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/distutils2/tests/test_mkcfg.py b/distutils2/tests/test_mkcfg.py
index 7e9da39..b289b49 100644
--- a/distutils2/tests/test_mkcfg.py
+++ b/distutils2/tests/test_mkcfg.py
@@ -8,6 +8,7 @@ from textwrap import dedent
from distutils2.tests import run_unittest, support, unittest
from distutils2.mkcfg import MainProgram
from distutils2.mkcfg import ask_yn, ask, main
+from distutils2._backport import sysconfig
class MkcfgTestCase(support.TempdirManager,
@@ -22,12 +23,18 @@ class MkcfgTestCase(support.TempdirManager,
self._cwd = os.getcwd()
self.wdir = self.mkdtemp()
os.chdir(self.wdir)
+ # patch sysconfig
+ self._old_get_paths = sysconfig.get_paths
+ sysconfig.get_paths = lambda *args, **kwargs: {
+ 'man': sys.prefix + '/share/man',
+ 'doc': sys.prefix + '/share/doc/pyxfoil',}
def tearDown(self):
super(MkcfgTestCase, self).tearDown()
sys.stdin = self._stdin
sys.stdout = self._stdout
os.chdir(self._cwd)
+ sysconfig.get_paths = self._old_get_paths
def test_ask_yn(self):
sys.stdin.write('y\n')