@@ -34,20 +34,25 @@ option `-p no:mypy-testing`.
3434# Writing Mypy Output Test Cases
3535
3636A mypy test case is a top-level functions decorated with
37- ` @pytest.mark.mypy_testing ` in a file name ` test_*.py ` or
38- ` test_*.mypy-testing ` . Note that we use the Python
37+ ` @pytest.mark.mypy_testing ` in a file named ` *.mypy-testing ` or in a
38+ pytest test module. ` pytest-mypy-testing ` follows the pytest logic in
39+ identifying test modules and respects the
40+ [ ` python_files ` ] ( https://docs.pytest.org/en/latest/reference.html#confval-python_files )
41+ config value.
42+
43+ Note that `` pytest-mypy-testing `` uses the Python
3944[ ast] ( https://docs.python.org/3/library/ast.html ) module to parse
40- candidate files and do not import any file, i.e., the decorator must
45+ candidate files and does not import any file, i.e., the decorator must
4146be exactly named ` @pytest.mark.mypy_testing ` .
4247
43- In a ` test_*.py ` file you may combine both regular pytest test
44- functions and mypy test functions. A single function can even be both.
48+ In a pytest test module file you may combine both regular pytest test
49+ functions and mypy test functions. A single function can be both.
4550
4651Example: A simple mypy test case could look like this:
4752
4853``` python
4954@pytest.mark.mypy_testing
50- def mypy_test_invalid_assginment ():
55+ def mypy_test_invalid_assginment () -> None :
5156 foo = " abc"
5257 foo = 123 # E: Incompatible types in assignment (expression has type "int", variable has type "str")
5358```
@@ -81,8 +86,33 @@ decorators are extracted from the ast.
8186# Development
8287
8388* Create and activate a Python virtual environment.
84- * Install development dependencies by calling `pip install - U - r requirements.txt` .
85- * Start developing
89+ * Install development dependencies by calling `python - m pip install
90+ - U - r requirements.txt`.
91+ * Start developing.
8692* To run all tests with [tox](https:// tox.readthedocs.io/ en/ latest/ ),
8793 Python 3.6 , 3.7 and 3.8 must be available. You might want to look
8894 into using [pyenv](https:// github.com/ pyenv/ pyenv).
95+
96+
97+ # Changelog
98+
99+ # # v0.0.7
100+
101+ * Fix `PYTEST_VERSION_INFO ` - by [@ blueyed](https:// github.com/ blueyed) (# 8)
102+ * Always pass `-- check- untyped- defs` to mypy (# 11)
103+ * Respect pytest config `python_files` when identifying pytest test modules (# 12)
104+
105+ # # v0.0.6 - add pytest 5.4 support
106+
107+ * Update the plugin to work with pytest 5.4 (# 7)
108+
109+ # # v0.0.5 - CI improvements
110+
111+ * Make invoke tasks work (partially) on Windows (# 6)
112+ * Add an invoke task to run tox environments by selecting globs (e.g.,
113+ `inv tox - e py-* ` ) (# 6)
114+ * Use coverage directly for code coverage to get more consistent
115+ parallel run results (# 6)
116+ * Use flit fork dflit to make packaging work with `LICENSES ` directory
117+ (# 6)
118+ * Bump dependencies (# 6)
0 commit comments