##// END OF EJS Templates
gh-7044: set TMPDIR to workingdir in tests
Jeroen Demeyer -
Show More
@@ -170,6 +170,9 b' class PyTestController(TestController):'
170 self.env['IPTEST_WORKING_DIR'] = workingdir.name
170 self.env['IPTEST_WORKING_DIR'] = workingdir.name
171 # This means we won't get odd effects from our own matplotlib config
171 # This means we won't get odd effects from our own matplotlib config
172 self.env['MPLCONFIGDIR'] = workingdir.name
172 self.env['MPLCONFIGDIR'] = workingdir.name
173 # For security reasons (http://bugs.python.org/issue16202), use
174 # a temporary directory to which other users have no access.
175 self.env['TMPDIR'] = workingdir.name
173
176
174 # Add a non-accessible directory to PATH (see gh-7053)
177 # Add a non-accessible directory to PATH (see gh-7053)
175 noaccess = os.path.join(self.workingdir.name, "_no_access_")
178 noaccess = os.path.join(self.workingdir.name, "_no_access_")
@@ -462,14 +462,13 b' def test_not_writable_ipdir():'
462 env.pop('XDG_CONFIG_HOME', None)
462 env.pop('XDG_CONFIG_HOME', None)
463 env['HOME'] = tmpdir
463 env['HOME'] = tmpdir
464 ipdir = os.path.join(tmpdir, '.ipython')
464 ipdir = os.path.join(tmpdir, '.ipython')
465 os.mkdir(ipdir)
465 os.mkdir(ipdir, 0o555)
466 os.chmod(ipdir, 600)
467 try:
466 try:
468 os.listdir(ipdir)
467 open(os.path.join(ipdir, "_foo_"), 'w').close()
469 except OSError:
468 except IOError:
470 pass
469 pass
471 else:
470 else:
472 # I can still read an unreadable dir,
471 # I can still write to an unwritable dir,
473 # assume I'm root and skip the test
472 # assume I'm root and skip the test
474 raise SkipTest("I can't create directories that I can't list")
473 raise SkipTest("I can't create directories that I can't list")
475 with AssertPrints('is not a writable location', channel='stderr'):
474 with AssertPrints('is not a writable location', channel='stderr'):
General Comments 0
You need to be logged in to leave comments. Login now