Skip to content

Commit

Permalink
use tmpdir fixture instead of mkdtemp()
Browse files Browse the repository at this point in the history
  • Loading branch information
aniederl committed Jan 16, 2025
1 parent 1d69535 commit 797fa31
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import stat
import subprocess
import sys
import tempfile
import textwrap
import time
import types
Expand Down Expand Up @@ -1064,13 +1063,12 @@ def test_cleaned_up_on_interrupt(self):

assert not d.exists()

def test_constructor_dir_argument(self):
def test_constructor_dir_argument(self, tmpdir):
"""
It should be possible to provide a dir argument to the constructor
"""
base = tempfile.mkdtemp()
with TempDir(dir=base) as d:
assert str(d).startswith(base)
with TempDir(dir=tmpdir) as d:
assert str(d).startswith(str(tmpdir))

def test_constructor_prefix_argument(self):
"""
Expand Down

0 comments on commit 797fa31

Please sign in to comment.