Giter Club home page Giter Club logo

Comments (19)

sobolevn avatar sobolevn commented on May 31, 2024 1

Yes, activate your venv then https://github.com/typeddjango/pytest-mypy-plugins/blob/master/.github/workflows/test.yml#L24-L29

from pytest-mypy-plugins.

sobolevn avatar sobolevn commented on May 31, 2024 1

Yes, I will reelase it this week! Thanks again!

from pytest-mypy-plugins.

sobolevn avatar sobolevn commented on May 31, 2024

Related #45

from pytest-mypy-plugins.

brunns avatar brunns commented on May 31, 2024

I'd be happy to work on a PR for this if it would be welcome.

from pytest-mypy-plugins.

sobolevn avatar sobolevn commented on May 31, 2024

@brunns it is! Thank you!

from pytest-mypy-plugins.

brunns avatar brunns commented on May 31, 2024

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.

brunns avatar brunns commented on May 31, 2024

I'm assuming we'd want a flag to activate this behavior. Otherwise,, the change wouldn't be backward compatible.

from pytest-mypy-plugins.

sobolevn avatar sobolevn commented on May 31, 2024

@brunns yes 👍

from pytest-mypy-plugins.

brunns avatar brunns commented on May 31, 2024

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.

brunns avatar brunns commented on May 31, 2024

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.

brunns avatar brunns commented on May 31, 2024

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.

sobolevn avatar sobolevn commented on May 31, 2024

What templates are you talking about in this context? 🤔

from pytest-mypy-plugins.

brunns avatar brunns commented on May 31, 2024

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.

sobolevn avatar sobolevn commented on May 31, 2024

Oh, I've missed this part. What kind of common-case templates do you think we need?

from pytest-mypy-plugins.

brunns avatar brunns commented on May 31, 2024

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.

brunns avatar brunns commented on May 31, 2024

It was with this in mind that I did #57, since it would presumably use the same engine.

from pytest-mypy-plugins.

brunns avatar brunns commented on May 31, 2024

#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.

brunns avatar brunns commented on May 31, 2024

Are you planning a release, @sobolevn? I'd find this very useful over at https://github.com/hamcrest/PyHamcrest !

from pytest-mypy-plugins.

sobolevn avatar sobolevn commented on May 31, 2024

Done! Thanks a lot @brunns

from pytest-mypy-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.