8000 Version 2.0.0 release (#119) · typeddjango/pytest-mypy-plugins@24f50c4 · GitHub
[go: up one dir, main page]

Skip to conten 8000 t

Commit 24f50c4

Browse files
authored
Version 2.0.0 release (#119)
1 parent 318b012 commit 24f50c4

File tree

5 files changed

+29
-5
lines changed

5 files changed

+29
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# Version history
22

33

4-
## WIP
4+
## 2.0.0
5+
6+
### Features
7+
8+
- Use `jinja2` instead of `chevron` for templating
9+
- Allow parametrizing `mypy_config` field in tests
10+
- Bump minimal `mypy` and `pytest` versions
511

612
### Bugfixes
713

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ Implementation notes:
128128
reveal_type({{ val }}) # N: Revealed type is '{{ rt }}'
129129
```
130130

131+
Properties that you can parametrize:
132+
- `main`
133+
- `mypy_config`
134+
- `out`
135+
131136
#### 3. Longer type expectations
132137

133138
```yaml

pytest_mypy_plugins/collect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def collect(self) -> Iterator["YamlTestItem"]:
131131
expected_output.extend(
132132
utils.extract_output_matchers_from_out(raw_test.get("out", ""), params, regex=regex)
133133
)
134-
additional_mypy_config = raw_test.get("mypy_config", "")
134+
additional_mypy_config = utils.render_template(template=raw_test.get("mypy_config", ""), data=params)
135135

136136
skip = self._eval_skip(str(raw_test.get("skip", "False")))
137137
if not skip:

pytest_mypy_plugins/tests/test-parametrized.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,16 @@
4545
out: |
4646
main:2: note: Revealed type is "{{ rt }}"
4747
main:4: error: Unsupported operand types for / ("str" and "int") [operator]
48+
49+
50+
- case: with_mypy_config
51+
parametrized:
52+
- allow_any: "true"
53+
- allow_any: "false"
54+
mypy_config: |
55+
disallow_any_explicit = {{ allow_any }}
56+
main: |
57+
# Anything will work, we just need to be sure that
58+
# `disallow_any_generics: Not a boolean: {{ allow_any }}`
59+
# is not raised
60+
1 + 1

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
readme = f.read()
55

66
dependencies = [
7-
"pytest>=6.2.0",
8-
"mypy>=0.970",
7+
"pytest>=7.0.0",
8+
"mypy>=1.3",
99
"decorator",
1010
"pyyaml",
1111
"Jinja2",
@@ -15,7 +15,7 @@
1515

1616
setup(
1717
name="pytest-mypy-plugins",
18-
version="1.11.1",
18+
version="2.0.0",
1919
description="pytest plugin for writing tests for mypy plugins",
2020
long_description=readme,
2121
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)
0