winipedia-utils 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- winipedia_utils/modules/module.py +2 -1
- winipedia_utils/testing/tests/base/fixtures/scopes/session.py +38 -0
- winipedia_utils/testing/tests/conftest.py +4 -2
- {winipedia_utils-0.1.3.dist-info → winipedia_utils-0.1.5.dist-info}/METADATA +1 -1
- {winipedia_utils-0.1.3.dist-info → winipedia_utils-0.1.5.dist-info}/RECORD +7 -7
- {winipedia_utils-0.1.3.dist-info → winipedia_utils-0.1.5.dist-info}/LICENSE +0 -0
- {winipedia_utils-0.1.3.dist-info → winipedia_utils-0.1.5.dist-info}/WHEEL +0 -0
@@ -73,7 +73,8 @@ def to_module_name(path: str | Path | ModuleType) -> str:
|
|
73
73
|
if isinstance(path, ModuleType):
|
74
74
|
return path.__name__
|
75
75
|
if isinstance(path, Path):
|
76
|
-
|
76
|
+
abs_path = path.resolve()
|
77
|
+
rel_path = abs_path.relative_to(Path.cwd())
|
77
78
|
if rel_path.suffix:
|
78
79
|
rel_path = rel_path.with_suffix("")
|
79
80
|
# return joined on . parts
|
@@ -196,6 +196,44 @@ def _test_all_src_code_in_one_package() -> None:
|
|
196
196
|
)
|
197
197
|
|
198
198
|
|
199
|
+
@autouse_session_fixture
|
200
|
+
def _test_src_package_correctly_named() -> None:
|
201
|
+
"""Verify that the source package is correctly named.
|
202
|
+
|
203
|
+
This fixture runs once per test session and checks that the source package
|
204
|
+
is correctly named after the project.
|
205
|
+
|
206
|
+
Raises:
|
207
|
+
AssertionError: If the source package is not correctly named
|
208
|
+
|
209
|
+
"""
|
210
|
+
src_package = get_src_package().__name__
|
211
|
+
assert_with_msg(
|
212
|
+
src_package == get_poetry_package_name(),
|
213
|
+
f"Expected source package to be named {get_poetry_package_name()}, "
|
214
|
+
f"but it is named {src_package}",
|
215
|
+
)
|
216
|
+
|
217
|
+
|
218
|
+
@autouse_session_fixture
|
219
|
+
def _test_py_typed_exists() -> None:
|
220
|
+
"""Verify that the py.typed file exists in the source package.
|
221
|
+
|
222
|
+
This fixture runs once per test session and checks that the py.typed file
|
223
|
+
exists in the source package.
|
224
|
+
|
225
|
+
Raises:
|
226
|
+
AssertionError: If the py.typed file doesn't exist
|
227
|
+
|
228
|
+
"""
|
229
|
+
src_package = get_src_package()
|
230
|
+
py_typed_path = to_path(src_package.__name__, is_package=True) / "py.typed"
|
231
|
+
assert_with_msg(
|
232
|
+
py_typed_path.exists(),
|
233
|
+
f"Expected py.typed file to exist at {py_typed_path}",
|
234
|
+
)
|
235
|
+
|
236
|
+
|
199
237
|
@autouse_session_fixture
|
200
238
|
def _test_project_structure_mirrored() -> None:
|
201
239
|
"""Verify that the project structure is mirrored in tests.
|
@@ -4,12 +4,14 @@ finds all the plugins in the tests directory and the package's testing module
|
|
4
4
|
and adds them to pytest_plugins. This way defining reusable fixtures is easy.
|
5
5
|
"""
|
6
6
|
|
7
|
-
|
7
|
+
import winipedia_utils
|
8
8
|
from winipedia_utils.modules.module import to_module_name, to_path
|
9
9
|
|
10
|
+
package_path = winipedia_utils.__path__[0]
|
11
|
+
|
10
12
|
custom_plugin_path = to_path("tests.base.fixtures", is_package=True)
|
11
13
|
package_plugin_path = (
|
12
|
-
to_path(
|
14
|
+
package_path / to_path("testing", is_package=True) / custom_plugin_path
|
13
15
|
)
|
14
16
|
|
15
17
|
custom_plugin_module_names = [
|
@@ -26,7 +26,7 @@ winipedia_utils/logging/logger.py,sha256=tCcUwAVLVr3Bec7_i-SoKvBPNCJSEmyuvBW2gbq
|
|
26
26
|
winipedia_utils/modules/__init__.py,sha256=e3CFaC3FhK4ibknFOv1bqOZxA7XeVwmLqWX7oajUm78,51
|
27
27
|
winipedia_utils/modules/class_.py,sha256=RDjal6QYYs9z81DT1mIFrnEhQ9vgN2tCAYN1WWnN24Y,2462
|
28
28
|
winipedia_utils/modules/function.py,sha256=Qn1OPV5dwO-7f3a0f0RpWcrH-E9teGPwldRtwbFYzRM,2551
|
29
|
-
winipedia_utils/modules/module.py,sha256=
|
29
|
+
winipedia_utils/modules/module.py,sha256=mxaAsRl02CAq_bTW2HsmzRWoyC9jKNM8Q4xdgdQlgd0,12719
|
30
30
|
winipedia_utils/modules/package.py,sha256=jPI7fcJ5VFWO7nRvjB6cGv_mahx0BUej9qhKARSK_Vk,12485
|
31
31
|
winipedia_utils/oop/__init__.py,sha256=wGjsVwLbTVEQWOfDJvN9nlvC-3NmAi8Doc2xIrm6e78,47
|
32
32
|
winipedia_utils/oop/mixins/__init__.py,sha256=PDK-cJcdRUfDUCz36qQ5pmMW07G133WtN49OpmILGNI,54
|
@@ -55,13 +55,13 @@ winipedia_utils/testing/tests/base/fixtures/scopes/class_.py,sha256=XCx4HZeHbJJ-
|
|
55
55
|
winipedia_utils/testing/tests/base/fixtures/scopes/function.py,sha256=5dW7-IPqJ_3Q2j1vftZL5FYKvNSKufqiHzLTTWYhja4,309
|
56
56
|
winipedia_utils/testing/tests/base/fixtures/scopes/module.py,sha256=V0H9WFrdSV7uj__bXM_GKcCJnjResqI7fFjcxyvNaZk,1169
|
57
57
|
winipedia_utils/testing/tests/base/fixtures/scopes/package.py,sha256=IKOfj6vfyjEQdRV5cJoPRQvALmePpGxWkGy23di00-w,309
|
58
|
-
winipedia_utils/testing/tests/base/fixtures/scopes/session.py,sha256=
|
58
|
+
winipedia_utils/testing/tests/base/fixtures/scopes/session.py,sha256=Wdesvis8BleXjm93jK99JLX4u9Oy2dY0GIx_3ipXYXo,9624
|
59
59
|
winipedia_utils/testing/tests/base/utils/__init__.py,sha256=mC-8dCkp8xarqkQu2QQLrPjHi6Ww9hcixWdHeQHWeRs,68
|
60
60
|
winipedia_utils/testing/tests/base/utils/utils.py,sha256=dUPDrgAxlfREQb33zz23MfzacLLuwjy2AO-PQQp_aSI,2820
|
61
|
-
winipedia_utils/testing/tests/conftest.py,sha256=
|
61
|
+
winipedia_utils/testing/tests/conftest.py,sha256=8409afzrE8LFRuex66XSZjp9N3yaLvele7Oz8FJ5KPw,846
|
62
62
|
winipedia_utils/text/__init__.py,sha256=j2bwtK6kyeHI6SnoBjpRju0C1W2n2paXBDlNjNtaUxA,48
|
63
63
|
winipedia_utils/text/string.py,sha256=1jbBftlgxffGgSlPnQh3aRPIr8XekEwpSenjFCW6JyM,3478
|
64
|
-
winipedia_utils-0.1.
|
65
|
-
winipedia_utils-0.1.
|
66
|
-
winipedia_utils-0.1.
|
67
|
-
winipedia_utils-0.1.
|
64
|
+
winipedia_utils-0.1.5.dist-info/LICENSE,sha256=3PrKJ2CWNrnyyHaC_r0wPDSukVWgmjOxHr__eQVH7cw,1087
|
65
|
+
winipedia_utils-0.1.5.dist-info/METADATA,sha256=thDj7ZsiYJwRtJhOZqlBF1o0lzLS7qJEHtXwOMOGknw,12384
|
66
|
+
winipedia_utils-0.1.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
67
|
+
winipedia_utils-0.1.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|