pytest-revealtype-injector 0.1.0__py3-none-any.whl → 0.1.1__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.
- pytest_revealtype_injector/__init__.py +1 -1
- pytest_revealtype_injector/adapter/mypy_.py +19 -2
- {pytest_revealtype_injector-0.1.0.dist-info → pytest_revealtype_injector-0.1.1.dist-info}/METADATA +1 -1
- {pytest_revealtype_injector-0.1.0.dist-info → pytest_revealtype_injector-0.1.1.dist-info}/RECORD +7 -8
- pytest_revealtype_injector-0.1.0.dist-info/licenses/COPYING.mit → pytest_revealtype_injector-0.1.1.dist-info/licenses/LICENSE +11 -1
- pytest_revealtype_injector-0.1.0.dist-info/licenses/COPYING +0 -6
- {pytest_revealtype_injector-0.1.0.dist-info → pytest_revealtype_injector-0.1.1.dist-info}/WHEEL +0 -0
- {pytest_revealtype_injector-0.1.0.dist-info → pytest_revealtype_injector-0.1.1.dist-info}/entry_points.txt +0 -0
|
@@ -168,8 +168,25 @@ class _MypyAdapter(TypeCheckerAdapter):
|
|
|
168
168
|
# Try stripping those character and pray we get something
|
|
169
169
|
# usable for evaluation
|
|
170
170
|
expression = m["type"].translate({ord(c): None for c in "*?="})
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
try:
|
|
172
|
+
# Unlike pyright, mypy output doesn't contain variable name
|
|
173
|
+
cls.typechecker_result[pos] = VarType(None, ForwardRef(expression))
|
|
174
|
+
except SyntaxError as e:
|
|
175
|
+
if (
|
|
176
|
+
m := re.fullmatch(r"<Deleted '(?P<var>.+)'>", expression)
|
|
177
|
+
) is not None:
|
|
178
|
+
raise TypeCheckerError(
|
|
179
|
+
"{} does not support reusing deleted variable '{}'".format(
|
|
180
|
+
cls.id, m["var"]
|
|
181
|
+
),
|
|
182
|
+
diag["file"],
|
|
183
|
+
diag["line"],
|
|
184
|
+
) from e
|
|
185
|
+
raise TypeCheckerError(
|
|
186
|
+
f"Cannot parse type expression '{expression}'",
|
|
187
|
+
diag["file"],
|
|
188
|
+
diag["line"],
|
|
189
|
+
) from e
|
|
173
190
|
|
|
174
191
|
@classmethod
|
|
175
192
|
def create_collector(
|
{pytest_revealtype_injector-0.1.0.dist-info → pytest_revealtype_injector-0.1.1.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pytest-revealtype-injector
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Pytest plugin for replacing reveal_type() calls inside test functions with static and runtime type checking result comparison, for confirming type annotation validity.
|
|
5
5
|
Project-URL: homepage, https://github.com/abelcheung/pytest-revealtype-injector
|
|
6
6
|
Author-email: Abel Cheung <abelcheung@gmail.com>
|
{pytest_revealtype_injector-0.1.0.dist-info → pytest_revealtype_injector-0.1.1.dist-info}/RECORD
RENAMED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
pytest_revealtype_injector/__init__.py,sha256
|
|
1
|
+
pytest_revealtype_injector/__init__.py,sha256=-sBG0VW8hqWI1JUSqzgJ6M0nptG5OWWQw9dzjnVpRQ8,211
|
|
2
2
|
pytest_revealtype_injector/hooks.py,sha256=5V2r19I47xQtCDd8ZAzXlqt3nYaBZ4CaMAyGP6w_Y0k,2414
|
|
3
3
|
pytest_revealtype_injector/main.py,sha256=dBlXcGc2NBcEHp0YX75Bp4Q7KY-t1oxlmPQS6o08U24,4490
|
|
4
4
|
pytest_revealtype_injector/models.py,sha256=hWo9Oz2ausmht-QpfMTTiCtdE3980IA2KEuch7mo_jk,3158
|
|
5
5
|
pytest_revealtype_injector/plugin.py,sha256=fkI6yF0dFVba0jEikIrsRp1NUQd2ohWLq4x2lSvFyH0,211
|
|
6
6
|
pytest_revealtype_injector/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
pytest_revealtype_injector/adapter/__init__.py,sha256=wQg3Ply0Xrfe9US_lzgqRgKFE89ZBvDFti6_77X_NKk,339
|
|
8
|
-
pytest_revealtype_injector/adapter/mypy_.py,sha256=
|
|
8
|
+
pytest_revealtype_injector/adapter/mypy_.py,sha256=qXZKppEwPYtCcRVBAvg8cLx2heI673w8cT9VftHNU_c,8237
|
|
9
9
|
pytest_revealtype_injector/adapter/pyright_.py,sha256=SEibrnMa0AAa1M3S4BmwEQ7ZgwQEUttsFOi-GWCrisA,4105
|
|
10
|
-
pytest_revealtype_injector-0.1.
|
|
11
|
-
pytest_revealtype_injector-0.1.
|
|
12
|
-
pytest_revealtype_injector-0.1.
|
|
13
|
-
pytest_revealtype_injector-0.1.
|
|
14
|
-
pytest_revealtype_injector-0.1.
|
|
15
|
-
pytest_revealtype_injector-0.1.0.dist-info/RECORD,,
|
|
10
|
+
pytest_revealtype_injector-0.1.1.dist-info/METADATA,sha256=ZNYRvvNfc1Hm5LAPyUvPcJWmqHqdFQxlQwviUovZJAE,3649
|
|
11
|
+
pytest_revealtype_injector-0.1.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
12
|
+
pytest_revealtype_injector-0.1.1.dist-info/entry_points.txt,sha256=UfOm7y3WQnOoGV1mgTMb42MI6iBRPIl88FJiAOnt6SY,74
|
|
13
|
+
pytest_revealtype_injector-0.1.1.dist-info/licenses/LICENSE,sha256=nLEPjqH24l4RByIq0dHIFhblIpcxpDrRX7sT3lBNoeM,1420
|
|
14
|
+
pytest_revealtype_injector-0.1.1.dist-info/RECORD,,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c) 2023-
|
|
1
|
+
Copyright (c) 2023-2025 Abel Cheung
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
4
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -17,3 +17,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
17
17
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
18
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
19
|
SOFTWARE.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
---------------------
|
|
23
|
+
|
|
24
|
+
pytest-revealtype-injector is released under MIT license (see above).
|
|
25
|
+
|
|
26
|
+
Original source code comes from part of types-lxml project, which is released
|
|
27
|
+
under Apache-2.0 license. But as the sole author of all relevant source code, it
|
|
28
|
+
is at my own discretion to follow pytest license because this project is taking
|
|
29
|
+
form of a pytest plugin.
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
pytest-revealtype-injector is released under MIT license (see COPYING.mit).
|
|
2
|
-
|
|
3
|
-
Original source code comes from part of types-lxml project, which is
|
|
4
|
-
release under Apache-2.0 license. But as the sole author of all source
|
|
5
|
-
code inside this repository, it is at my own discretion to follow pytest
|
|
6
|
-
license because this project is taking shape as a pytest plugin.
|
{pytest_revealtype_injector-0.1.0.dist-info → pytest_revealtype_injector-0.1.1.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|