This commit is contained in:
@@ -155,10 +155,22 @@ def async_test(coro):
|
|||||||
|
|
||||||
|
|
||||||
@decorator_with_kwargs
|
@decorator_with_kwargs
|
||||||
def tmpdir(f, argument_name='tmpdir'):
|
def tmpdir(f,
|
||||||
|
argument_name='temp_dir',
|
||||||
|
suffix=None,
|
||||||
|
prefix=None,
|
||||||
|
dir=None,
|
||||||
|
ignore_cleanup_errors=False,
|
||||||
|
delete=True):
|
||||||
|
|
||||||
@wraps(f)
|
@wraps(f)
|
||||||
def result(*args, **kwargs):
|
def result(*args, **kwargs):
|
||||||
with TemporaryDirectory() as temp_dir:
|
with TemporaryDirectory(
|
||||||
|
suffix=suffix,
|
||||||
|
prefix=prefix,
|
||||||
|
dir=dir,
|
||||||
|
ignore_cleanup_errors=ignore_cleanup_errors,
|
||||||
|
delete=delete) as temp_dir:
|
||||||
f(*args, **kwargs, **{
|
f(*args, **kwargs, **{
|
||||||
argument_name: Path(temp_dir)
|
argument_name: Path(temp_dir)
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user