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 django commands with call_command causes None to be cached with testmon 1.0.0 #145

Closed
TauPan opened this issue Nov 26, 2019 · 7 comments

Comments

@TauPan
Copy link

TauPan commented Nov 26, 2019

Hi!

I accidentally upgraded to testmon 1.0.0 yesterday, because I had the impression that it was stable. (Maybe because it's the current version on pypi, see https://pypi.org/project/pytest-testmon/ ... but here on github the latest release is 0.9.18.)

I stumbled across this problem where I'm testing django commands with call_command (as described in https://docs.djangoproject.com/en/2.2/topics/testing/tools/#topics-testing-management-commands ) and this causes None to be stored in the cache.

I've made a small github project to reproduce this. Results are in https://travis-ci.org/TauPan/pytest-testmon-bug-none-in-cache

I didn't add different versions of django, as I'm not sure how to do this on travis (maybe I should use tox) and the bug is reproduced.

@TauPan
Copy link
Author

TauPan commented Nov 26, 2019

Parametrized django version now, same bug with 2.1 and 2.2 as well.

@TauPan
Copy link
Author

TauPan commented Nov 26, 2019

The behaviour is not triggered with pytest-testmon 0.9.19 (or lower).

@tarpas
Copy link
Owner

tarpas commented Nov 26, 2019

There was a 1.0.0 alpha and RC and this didn't get reported yet. So 1.0.0 should be stable but this slipped through. Thanks a lot for the thorough report! We'll have a look tomorrow.

I also marked the 1.0.0 release here on Github.

Matlino added a commit that referenced this issue Nov 27, 2019
We were creating Module based on code variable value. When file is empty code was empty string and we didnt create Module instance, instead we returned None. This was causing crash in make_nodedata because file exists but module instance was None.

Not we create Module instance based on checksum value. Checksum is defined even if file is empty.
@Matlino
Copy link
Contributor

Matlino commented Nov 27, 2019

@TauPan Problem was fixed, new version is on pypi. You can try it out :)

@tarpas tarpas closed this as completed Nov 27, 2019
@TauPan
Copy link
Author

TauPan commented Nov 28, 2019

@TauPan Problem was fixed, new version is on pypi. You can try it out :)

Thanks! I've allowed ~= 1.0.0 in my testrepo and with pytest-testmon 1.0.1 all travis builds go green. \o/

@blueyed
Copy link
Contributor

blueyed commented Nov 30, 2019

@TauPan
Out of interest: do you use testmon actively on CI, i.e. to run less tests there?
If so, can you elaborate on how you're doing this, e.g. with regard to PRs vs master builds etc (do you re-run all tests on master build always for example)?

@TauPan
Copy link
Author

TauPan commented Nov 30, 2019

@TauPan
Out of interest: do you use testmon actively on CI, i.e. to run less tests there?

Nope. I use travis almost exclusively to reproduce complicated github issues.

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

No branches or pull requests

4 participants