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

Add a fix for nose2's own subprocess tests (on top of #601) #605

Merged
merged 4 commits into from
Apr 27, 2024

Conversation

sirosen
Copy link
Collaborator

@sirosen sirosen commented Apr 27, 2024

I picked up #601 and it looks good with some very minor tweaking to the tests (to fix Process instantiation).

I then poked around at fixing the mysterious issues with coverage, and cooked up this fix after looking closely at the "NotReallyAProc" trickery which is used inside of the testsuite. My understanding of it is that it's a speed boost for the tests (especially Windows, where subprocess invocation is super slow). But if it makes tests fail, it's not doing any good. Slow and correct is much better than fast and wrong.

JCHacking and others added 4 commits April 11, 2024 19:20
nose2's testsuite does not really create subprocesses for most
executions. This keeps things fast by doing all of the work in the
current process, but is self-defeating when we really *do* want to
isolate the work into a proper sub-execution and check the results, as
is the case with `coverage` invocations (which involve coverage's own
state on a per-interpreter basis).

To resolve, add a helper for doing true subprocess invocations where
appropriate, and use it to fix the broken coverage tests.

A few minor edits were also needed to get this all working:
- fix some subproc invocations using `target=...`
- remove strange code from the "coverage of imports" scenario [^1]

[^1]: I was the author of said scenario, many years ago. The commit
history doesn't show it, but my suspicion is that with the test
skipped, it was just a save of whatever my work in progress was, as I
tried to get the test working at the time. It's hard to be certain,
but the code in that file doesn't have a clearly credible reason to
exist.
@sirosen sirosen merged commit 3de648a into main Apr 27, 2024
20 checks passed
@sirosen sirosen deleted the add-fix-for-subproc-tests branch April 27, 2024 23:09
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

Successfully merging this pull request may close these issues.

None yet

2 participants