[pypy-svn] r8206 - pypy/branch/src-pytest/pypy/appspace/test
hpk at codespeak.net
hpk at codespeak.net
Tue Jan 11 14:55:51 CET 2005
Author: hpk
Date: Tue Jan 11 14:55:51 2005
New Revision: 8206
Modified:
pypy/branch/src-pytest/pypy/appspace/test/support_tests.py
Log:
get rid of that obnoxious "@test" files which are
created if you run the tests in appspace. This
now uses the "per-test-session" tempdir and
does that by going to py.test.config.tempdir.
However, when e.g. running cpy_builtin_functions.py
which imports support_tests.py this will now
import the py lib at app-level (which fails
for shallow reasons). Anyway, i think when
caring for regrtests we will certainly substitute
support_tests and will try to keep the original
regr-tests as much as possible ...
in short: this whole current appspace mess will hopefully
go away soon.
Modified: pypy/branch/src-pytest/pypy/appspace/test/support_tests.py
==============================================================================
--- pypy/branch/src-pytest/pypy/appspace/test/support_tests.py (original)
+++ pypy/branch/src-pytest/pypy/appspace/test/support_tests.py Tue Jan 11 14:55:51 2005
@@ -8,6 +8,9 @@
import sys
from os import unlink
+import py
+TESTFN = str(py.test.config.tempdir.join('@test'))
+
class Error(Exception):
"""Base class for regression test exceptions."""
@@ -117,21 +120,7 @@
is_jython = sys.platform.startswith('java')
-TESTFN = '@test'
-# Make sure we can write to TESTFN, try in /tmp if we can't
-fp = None
-try:
- fp = open(TESTFN, 'w+')
-except IOError:
- TMP_TESTFN = os.path.join('/tmp', TESTFN)
- try:
- fp = open(TMP_TESTFN, 'w+')
- TESTFN = TMP_TESTFN
- del TMP_TESTFN
- except IOError:
- print ('WARNING: tests will fail, unable to write to: %s or %s' %
- (TESTFN, TMP_TESTFN))
if fp is not None:
fp.close()
del fp
More information about the Pypy-commit
mailing list