Skip to content

Commit e30a16d

Browse files
committed
Consolidated test support logic in jaraco.test.cpython.
1 parent 41ca039 commit e30a16d

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ testing =
3737
pyfakefs
3838
flufl.flake8
3939
pytest-perf >= 0.9.2
40-
jaraco.collections
40+
jaraco.test >= 5.4
4141

4242
docs =
4343
# upstream

tests/compat/py39.py

+4-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
import types
1+
from jaraco.test.cpython import from_test_support, try_import
22

3-
from jaraco.collections import Projection
43

5-
6-
def from_test_support(*names):
7-
"""
8-
Return a SimpleNamespace of names from test.support.
9-
"""
10-
import test.support
11-
12-
return types.SimpleNamespace(**Projection(names, vars(test.support)))
13-
14-
15-
try:
16-
from test.support import os_helper # type: ignore
17-
except ImportError:
18-
os_helper = from_test_support('FS_NONASCII', 'skip_unless_symlink')
4+
os_helper = try_import('os_helper') or from_test_support(
5+
'FS_NONASCII', 'skip_unless_symlink'
6+
)

0 commit comments

Comments
 (0)