[Python-Dev] [Python-checkins] r86965 - python/branches/py3k/Lib/test/main.py (original) (raw)
Michael Foord fuzzyman at voidspace.org.uk
Fri Dec 3 11:56:21 CET 2010
- Previous message: [Python-Dev] [Python-checkins] r86965 - python/branches/py3k/Lib/test/__main__.py
- Next message: [Python-Dev] r86962 - in python/branches/py3k: Doc/library/pydoc.rst Doc/whatsnew/3.2.rst Lib/pydoc.py Lib/test/test_pydoc.py Misc/ACKS Misc/NEWS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 03/12/2010 10:53, Nick Coghlan wrote:
On Fri, Dec 3, 2010 at 8:42 PM, michael.foord <python-checkins at python.org> wrote:
+# When tests are run from the Python build directory, it is best practice +# to keep the test files in a subfolder. It eases the cleanup of leftover +# files using command "make distclean". +if sysconfig.ispythonbuild(): + TEMPDIR = os.path.join(sysconfig.getconfigvar('srcdir'), 'build') + TEMPDIR = os.path.abspath(TEMPDIR) + if not os.path.exists(TEMPDIR): + os.mkdir(TEMPDIR) + regrtest.TEMPDIR = TEMPDIR If syconfig.ispythonbuild() returns False...
+# Define a writable temp dir that will be used as cwd while running +# the tests. The name of the dir includes the pid to allow parallel +# testing (see the -j option). +TESTCWD = 'testpython{}'.format(os.getpid()) + +TESTCWD = os.path.join(TEMPDIR, TESTCWD) ... this line is going to blow up with a NameError. I would suggest putting this common setup code into a maketestdir() helper function in regrtest, then have both regrtest and test.main call it.
Ok, good suggestion. Thanks
Michael
Cheers, Nick.
--
READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.
- Previous message: [Python-Dev] [Python-checkins] r86965 - python/branches/py3k/Lib/test/__main__.py
- Next message: [Python-Dev] r86962 - in python/branches/py3k: Doc/library/pydoc.rst Doc/whatsnew/3.2.rst Lib/pydoc.py Lib/test/test_pydoc.py Misc/ACKS Misc/NEWS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]