Skip to content

Commit 3218cc5

Browse files
authored
feat: Expose TEST_PROFILE_NAME for testing module accessibility
1 parent 68a368e commit 3218cc5

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

injection/testing/__init__.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from injection.loaders import LoadedProfile, ProfileLoader, load_profile
55

66
__all__ = (
7+
"TEST_PROFILE_NAME",
78
"load_test_profile",
89
"reserve_scoped_test_slot",
910
"set_test_constant",
@@ -14,16 +15,16 @@
1415
"test_singleton",
1516
)
1617

17-
_TEST_PROFILE_NAME: Final[str] = "__testing__"
18+
TEST_PROFILE_NAME: Final[str] = "__testing__"
1819

19-
reserve_scoped_test_slot = mod(_TEST_PROFILE_NAME).reserve_scoped_slot
20-
set_test_constant = mod(_TEST_PROFILE_NAME).set_constant
21-
should_be_test_injectable = mod(_TEST_PROFILE_NAME).should_be_injectable
22-
test_constant = mod(_TEST_PROFILE_NAME).constant
23-
test_injectable = mod(_TEST_PROFILE_NAME).injectable
24-
test_scoped = mod(_TEST_PROFILE_NAME).scoped
25-
test_singleton = mod(_TEST_PROFILE_NAME).singleton
20+
reserve_scoped_test_slot = mod(TEST_PROFILE_NAME).reserve_scoped_slot
21+
set_test_constant = mod(TEST_PROFILE_NAME).set_constant
22+
should_be_test_injectable = mod(TEST_PROFILE_NAME).should_be_injectable
23+
test_constant = mod(TEST_PROFILE_NAME).constant
24+
test_injectable = mod(TEST_PROFILE_NAME).injectable
25+
test_scoped = mod(TEST_PROFILE_NAME).scoped
26+
test_singleton = mod(TEST_PROFILE_NAME).singleton
2627

2728

2829
def load_test_profile(loader: ProfileLoader | None = None) -> LoadedProfile:
29-
return load_profile(_TEST_PROFILE_NAME, loader)
30+
return load_profile(TEST_PROFILE_NAME, loader)

injection/testing/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ from typing import Final
33
from injection import Module
44
from injection.loaders import LoadedProfile, ProfileLoader
55

6+
TEST_PROFILE_NAME: Final[str] = ...
7+
68
__MODULE: Final[Module] = ...
79

810
reserve_scoped_test_slot = __MODULE.reserve_scoped_slot

0 commit comments

Comments
 (0)