Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing changes and caching behaviour #144

Open
delfick opened this issue Mar 29, 2024 · 5 comments
Open

Testing changes and caching behaviour #144

delfick opened this issue Mar 29, 2024 · 5 comments

Comments

@delfick
Copy link
Contributor

delfick commented Mar 29, 2024

Hello,

I'm not sure if I'm missing something obvious, but is there patterns for testing how my plugin interacts with mypy caching for both mypy and dmypy when code is changed?

So say I make a test case with code in a particular way and it passes mypy. I want a test that show it still passes mypy if I change that code in a particular way. Same with dmypy.

@sobolevn
Copy link
Member

Right now this is not supported, but PR for this would be really welcomed!
Mypy test cases have a similar design, here: https://github.com/python/mypy/blob/master/test-data/unit/check-incremental.test

@delfick
Copy link
Contributor Author

delfick commented Mar 29, 2024

mmkay, I thought so. Thanks. I will add this to the list of things I want to look at (no guarantees on a timeline :p)

@delfick
Copy link
Contributor Author

delfick commented May 6, 2024

So on this, once you're happy with #152 and that's merged, I have one last prefactor lined up (delfick/pytest-mypy-plugins@schema/split-from-execution...delfick:pytest-mypy-plugins:separation/use-fixtures, will have an explanation of what it's doing when I make it a PR) and then finally the changes to make it possible to specify followups - delfick/pytest-mypy-plugins@separation/use-fixtures...delfick:pytest-mypy-plugins:scenarios/followups

Though I have a problem I haven't quite being able to figure out where I change a file and then mypy doesn't see the change to that file. But if I do the same thing outside of pytest it does see the change. It's very weird.

edit: using the power of sleeping on it, I fixed the problem delfick@89f2d52

@delfick
Copy link
Contributor Author

delfick commented May 7, 2024

yay, after that current PR and the next two, I think I have all the changes in a state that is ready to use, was able to make this test on my extension on django-stubs https://github.com/delfick/extended-mypy-django-plugin/actions/runs/8981236513/job/24666367526 to show one of the things I need to fix that was slowing me down so much (an edge case where an app is removed from INSTALLED_APPS but is still present on the file system)

@delfick
Copy link
Contributor Author

delfick commented May 23, 2024

@sobolevn hello, I was wondering, I do want to eventually upstream these changes to this project, but my changes are quite extensive and your time for reviewing appears to be limited. Do you mind if I make my fork into it's own package in the meantime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants