Skip to content

Commit

Permalink
Utilize temp_dir from os_helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed May 16, 2024
1 parent cdbd58b commit b754ab7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
1 change: 1 addition & 0 deletions tests/compat/py39.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

os_helper = try_import('os_helper') or from_test_support(
'FakePath',
'temp_dir',
)

sys.modules[__name__ + '.os_helper'] = os_helper
13 changes: 1 addition & 12 deletions tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
import itertools
import contextlib
import pathlib
import tempfile
import shutil
import pickle
import sys
import unittest
import zipfile

from .compat.py39.os_helper import FakePath
from .compat.py39.os_helper import temp_dir, FakePath

import jaraco.itertools
from jaraco.functools import compose
Expand Down Expand Up @@ -63,15 +61,6 @@ def build_alpharep_fixture():
return zf


@contextlib.contextmanager
def temp_dir():
tmpdir = tempfile.mkdtemp()
try:
yield pathlib.Path(tmpdir)
finally:
shutil.rmtree(tmpdir)


alpharep_generators = [
Invoked.wrap(build_alpharep_fixture),
Invoked.wrap(compose(zipp.CompleteDirs.inject, build_alpharep_fixture)),
Expand Down

0 comments on commit b754ab7

Please sign in to comment.