Author eryksun
Recipients eryksun, tim.golden
Date 2018-07-27.05:39:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532669958.14.0.56676864532.issue34240@psf.upfronthosting.co.za>
In-reply-to
Content
To clarify, TEMPDIR in this case is from the following code in Lib/test/libregrtest/main.py:

    # When tests are run from the Python build directory, it is best practice
    # to keep the test files in a subfolder.  This eases the cleanup of leftover
    # files using the "make distclean" command.
    if sysconfig.is_python_build():
        TEMPDIR = sysconfig.get_config_var('abs_builddir')
        if TEMPDIR is None:
            # bpo-30284: On Windows, only srcdir is available. Using abs_builddir
            # mostly matters on UNIX when building Python out of the source tree,
            # especially when the source tree is read only.
            TEMPDIR = sysconfig.get_config_var('srcdir')
        TEMPDIR = os.path.join(TEMPDIR, 'build')
    else:
        TEMPDIR = tempfile.gettempdir()
    TEMPDIR = os.path.abspath(TEMPDIR)

Then in class Regrtest we have:

    def main(self, tests=None, **kwargs):
        global TEMPDIR

        if sysconfig.is_python_build():
            try:
                os.mkdir(TEMPDIR)
            except FileExistsError:
                pass

        # 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).
        test_cwd = 'test_python_{}'.format(os.getpid())
        test_cwd = os.path.join(TEMPDIR, test_cwd)

        # Run the tests in a context manager that temporarily changes the CWD to a
        # temporary and writable directory.  If it's not possible to create or
        # change the CWD, the original CWD will be used.  The original CWD is
        # available from support.SAVEDCWD.
        with support.temp_cwd(test_cwd, quiet=True):
            self._main(tests, kwargs)
History
Date User Action Args
2018-07-27 05:39:18eryksunsetrecipients: + eryksun, tim.golden
2018-07-27 05:39:18eryksunsetmessageid: <1532669958.14.0.56676864532.issue34240@psf.upfronthosting.co.za>
2018-07-27 05:39:18eryksunlinkissue34240 messages
2018-07-27 05:39:17eryksuncreate