Comments (19)
Yes, activate your venv
then https://github.com/typeddjango/pytest-mypy-plugins/blob/master/.github/workflows/test.yml#L24-L29
from pytest-mypy-plugins.
Yes, I will reelase it this week! Thanks again!
from pytest-mypy-plugins.
Related #45
from pytest-mypy-plugins.
I'd be happy to work on a PR for this if it would be welcome.
from pytest-mypy-plugins.
@brunns it is! Thank you!
from pytest-mypy-plugins.
Is there a one-liner for running the tests, or do I create and activate a venv by hand, then run pytest?
from pytest-mypy-plugins.
I'm assuming we'd want a flag to activate this behavior. Otherwise,, the change wouldn't be backward compatible.
from pytest-mypy-plugins.
@brunns yes 👍
from pytest-mypy-plugins.
So, two options really. There could be have a flag level test, or the comment could be annotated somehow, so we could mix the two styles. Or, I suppose, both? I've made a start on the former approach in #55 (though not actually implemented the functionality yet!) but it would be easy enough to allow both options.
from pytest-mypy-plugins.
OK, #55 now implements regex matching of the messages, with a flag at the test level. Can someone let me know if I'm heading in the right direction? If so, I'll look at allowing regexes for specific messages, and also maybe the template idea.
from pytest-mypy-plugins.
Templates - would we want those at the level of a single test, or a single set of tests across the whole test file? I'm thinking the latter, given that the aim is to enable reuse.
from pytest-mypy-plugins.
What templates are you talking about in this context? 🤔
from pytest-mypy-plugins.
It might also be possible to make the expected strings templates to enable reuse, and perhaps package some of the common patterns with the tool.
From the original issue report.
from pytest-mypy-plugins.
Oh, I've missed this part. What kind of common-case templates do you think we need?
from pytest-mypy-plugins.
I don't need them myself, but the OP's example included being able to specify a reveal
template which expands to "Revealed type is"
, and another template which expands to the regex "(?:\*|`-?\d+)".
from pytest-mypy-plugins.
It was with this in mind that I did #57, since it would presumably use the same engine.
from pytest-mypy-plugins.
#58 contains a sketch of a solution. BTW, I believe that if templates at the individual test level is prefered, you can already do that using parametrized
and a single set of values.
from pytest-mypy-plugins.
Are you planning a release, @sobolevn? I'd find this very useful over at https://github.com/hamcrest/PyHamcrest !
from pytest-mypy-plugins.
Done! Thanks a lot @brunns
from pytest-mypy-plugins.
Related Issues (20)
- Getting `project is in the MYPYPATH. Please remove it.` with latest mypy HOT 3
- Test failures using Python 3.11 and Mypy 0.981 HOT 4
- greater-than sign in parametrized values (to check function return values)
- Fails in Python 3.12 due to usage of pkg_resources HOT 3
- sdist is missing tests HOT 5
- chevron is not maintained
- Allow parametrizing `mypy_config`
- Support `--mypy-extra-options` CLI flag
- How to solve Python 3.8/3.9 changes in typing representation HOT 4
- Is there a way to mark `xfail` tests, also with matching output?
- "FileNotFoundError" due to missing "schema.json" after installation
- Add plugin configuration through pyproject.toml? HOT 5
- Ignore mypy errors from site-packages imports HOT 3
- Adjust test-mypy-config.yml to test with more stable mypy options HOT 1
- Allow custom properties in our json schema HOT 1
- New deprecation warning with pytest 8.1 (YamlTestFile not using a cooperative constructor) HOT 2
- Setting `--python-version` overrides option in `--mypy-ini-file` HOT 1
- mypy_config documentation is confusing HOT 2
- Error formatting hangs indefinitely with `regex: true` HOT 1
- Feature proposal: Allow specifying out as list HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-mypy-plugins.