Skip to content

Commit

Permalink
Refresh from importlib_metadata@cpython
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed May 10, 2019
1 parent a277d85 commit 58533a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/test/test_importlib/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
@contextlib.contextmanager
def tempdir():
tmpdir = tempfile.mkdtemp()
sys.path[:0] = [tmpdir]
try:
yield pathlib.Path(tmpdir)
finally:
sys.path.remove(tmpdir)
shutil.rmtree(tmpdir)


Expand All @@ -55,7 +53,10 @@ class SiteDir:
def site_dir():
with tempdir() as tmp:
sys.path[:0] = [str(tmp)]
yield tmp
try:
yield tmp
finally:
sys.path.remove(str(tmp))

def setUp(self):
self.fixtures = ExitStack()
Expand Down Expand Up @@ -193,4 +194,3 @@ def build_files(file_defs, prefix=pathlib.Path()):
def DALS(str):
"Dedent and left-strip"
return textwrap.dedent(str).lstrip()

0 comments on commit 58533a7

Please sign in to comment.