(self)
| 125 | self.options = options |
| 126 | |
| 127 | def setup(self): |
| 128 | ipydir = TemporaryDirectory() |
| 129 | self.dirs.append(ipydir) |
| 130 | self.env['IPYTHONDIR'] = ipydir.name |
| 131 | self.workingdir = workingdir = TemporaryDirectory() |
| 132 | self.dirs.append(workingdir) |
| 133 | self.env['IPTEST_WORKING_DIR'] = workingdir.name |
| 134 | # This means we won't get odd effects from our own matplotlib config |
| 135 | self.env['MPLCONFIGDIR'] = workingdir.name |
| 136 | # For security reasons (http://bugs.python.org/issue16202), use |
| 137 | # a temporary directory to which other users have no access. |
| 138 | self.env['TMPDIR'] = workingdir.name |
| 139 | |
| 140 | # Add a non-accessible directory to PATH (see gh-7053) |
| 141 | noaccess = os.path.join(self.workingdir.name, "_no_access_") |
| 142 | self.noaccess = noaccess |
| 143 | os.mkdir(noaccess, 0) |
| 144 | |
| 145 | PATH = os.environ.get('PATH', '') |
| 146 | if PATH: |
| 147 | PATH = noaccess + os.pathsep + PATH |
| 148 | else: |
| 149 | PATH = noaccess |
| 150 | self.env['PATH'] = PATH |
| 151 | |
| 152 | # From options: |
| 153 | if self.options.xunit: |
| 154 | self.add_xunit() |
| 155 | if self.options.coverage: |
| 156 | self.add_coverage() |
| 157 | self.env['IPTEST_SUBPROC_STREAMS'] = self.options.subproc_streams |
| 158 | self.cmd.extend(self.options.extra_args) |
| 159 | |
| 160 | def cleanup(self): |
| 161 | """ |
no test coverage detected