-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support Django Test Runs with Coverage #24199
Comments
The problem occurs because coverage is run in-process using Here are some approaches to fixing it. Keep Three variations on this:
Don't run In this case, we'd simply replace I think all of these have their plusses and minuses. This is my first time here and I'm just working on a weekend project so I don't know the backstory on the current implementation. I like the |
I read the documentation about testing and it doesn't mention that coverage in Django tests is not yet supported, so I was lost in the dark until I found this issue right here, I think it would be nice if this information was added as a disclaimer |
great point @mcobalchinisoftfocus! @cwebster-99, could we include this in our docs update? |
Hi, @eleanorjboyd Could you take a look at my PR #24927? I think I've fixed the issue. |
#24199 Co-authored-by: Danila Grobov (s4642g) <[email protected]>
Related to this issue: #24199 @mcobalchinisoftfocus Discovered an issue with older django versions, which didn't have the main function in the manage.py #24927 (comment) I've fixed this issue by executing the code in manage.py with __name__ set to __main__ instead of relying on main function being there. I've also adjusted the test, so that it would cover this case.
make sure Coverage works while running Django and that the scenario is supported.
originally raised in #22827 (comment)
The text was updated successfully, but these errors were encountered: