[Feature Request]: use PopenStub in more test cases #21258
Labels
enhancement
Label to indicate an issue is a feature/improvement
Impact: Medium
Will improve quality-of-life for at least 30% of users.
Work: Medium
The means to find the solution is clear, but it isn't at good-first-issue level yet.
Is your feature request related to a problem? Please describe.
Hi, I've recently tried to collaborate with the project and had some contact with test cases. I saw that there are a lot of tests that need to mock a sub-process call, and most of them accomplish this by creating a mock that calls a "cheaper" sub-process such as
echo test
.But the project has a Stub for mocking the Popen class:
https://github.com/oppia/oppia/blob/6f2156f/scripts/scripts_test_utils.py#L28
As a suggestion: those scripts tests could be updated to use the stub, to run faster/cheaper tests.
Describe the solution (or solutions) you'd like
Replace occurrences of
subprocess.Popen
that actually call sub-processes in the scripts tests (atscripts/**/*_test.py
) with thePopenStub
Stub class.Describe alternatives you've considered and rejected
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: