Skip to content

Commit

Permalink
Version 2.0.0 release (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Jun 29, 2023
1 parent 318b012 commit 24f50c4
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Version history


## WIP
## 2.0.0

### Features

- Use `jinja2` instead of `chevron` for templating
- Allow parametrizing `mypy_config` field in tests
- Bump minimal `mypy` and `pytest` versions

### Bugfixes

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ Implementation notes:
reveal_type({{ val }}) # N: Revealed type is '{{ rt }}'
```

Properties that you can parametrize:
- `main`
- `mypy_config`
- `out`

#### 3. Longer type expectations

```yaml
Expand Down
2 changes: 1 addition & 1 deletion pytest_mypy_plugins/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def collect(self) -> Iterator["YamlTestItem"]:
expected_output.extend(
utils.extract_output_matchers_from_out(raw_test.get("out", ""), params, regex=regex)
)
additional_mypy_config = raw_test.get("mypy_config", "")
additional_mypy_config = utils.render_template(template=raw_test.get("mypy_config", ""), data=params)

skip = self._eval_skip(str(raw_test.get("skip", "False")))
if not skip:
Expand Down
13 changes: 13 additions & 0 deletions pytest_mypy_plugins/tests/test-parametrized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,16 @@
out: |
main:2: note: Revealed type is "{{ rt }}"
main:4: error: Unsupported operand types for / ("str" and "int") [operator]
- case: with_mypy_config
parametrized:
- allow_any: "true"
- allow_any: "false"
mypy_config: |
disallow_any_explicit = {{ allow_any }}
main: |
# Anything will work, we just need to be sure that
# `disallow_any_generics: Not a boolean: {{ allow_any }}`
# is not raised
1 + 1
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
readme = f.read()

dependencies = [
"pytest>=6.2.0",
"mypy>=0.970",
"pytest>=7.0.0",
"mypy>=1.3",
"decorator",
"pyyaml",
"Jinja2",
Expand All @@ -15,7 +15,7 @@

setup(
name="pytest-mypy-plugins",
version="1.11.1",
version="2.0.0",
description="pytest plugin for writing tests for mypy plugins",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 24f50c4

Please sign in to comment.