You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If tests are invoked with --mypy-testing-base that is not valid (doesn't exist, is a file, user has no permissions to write) we fail and escalate to UnboundLocalError:
Traceback (most recent call last):
File "/path/to/pytest-mypy-plugins/pytest_mypy_plugins/item.py", line 231, in runtest
temp_dir = tempfile.TemporaryDirectory(prefix="pytest-mypy-", dir=self.root_directory)
File "/usr/lib/python3.9/tempfile.py", line 918, in __init__
self.name = mkdtemp(suffix, prefix, dir)
File "/usr/lib/python3.9/tempfile.py", line 498, in mkdtemp
_os.mkdir(file, 0o700)
NotADirectoryError: [Errno 20] Not a directory: '/tmp/foo/pytest-mypy-k7frqt99'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/path/to/lib/python3.9/site-packages/_pytest/runner.py", line 311, in from_call
result: Optional[TResult] = func()
File "/path/to/lib/python3.9/site-packages/_pytest/runner.py", line 255, in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
File "/path/to/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/path/to/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/path/to/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
return outcome.get_result()
File "/path/to/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/path/to/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/path/to/lib/python3.9/site-packages/_pytest/runner.py", line 170, in pytest_runtest_call
raise e
File "/path/to/lib/python3.9/site-packages/_pytest/runner.py", line 162, in pytest_runtest_call
item.runtest()
File "/path/to/pytest-mypy-plugins/pytest_mypy_plugins/item.py", line 276, in runtest
temp_dir.cleanup()
UnboundLocalError: local variable 'temp_dir' referenced before assignm
This is because we create temp directory in a try block
If tests are invoked with
--mypy-testing-base
that is not valid (doesn't exist, is a file, user has no permissions to write) we fail and escalate toUnboundLocalError
:This is because we create temp directory in a
try
blockpytest-mypy-plugins/pytest_mypy_plugins/item.py
Lines 230 to 231 in 1ad40a9
that corresponds
finally
block responsible for cleanuppytest-mypy-plugins/pytest_mypy_plugins/item.py
Lines 275 to 276 in 1ad40a9
The text was updated successfully, but these errors were encountered: