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

Switch to using unittest.main and custom runner for unittest design #22388

Open
eleanorjboyd opened this issue Oct 30, 2023 · 6 comments
Open
Assignees
Labels
area-testing needs proposal Need to make some design decisions

Comments

@eleanorjboyd
Copy link
Member

Currently the steps to run unittest tests are broken down into individually calling:

loader = unittest.TestLoader()
tailor: unittest.TestSuite = loader.loadTestsFromNames(test_ids)
result: UnittestTestResult = runner.run(tailor)  # type: ignore

This limits our ability to run tests as similar to how they are run in the command line and to move all heavy lifting over to unittest.

Instead we should use unittest.main(module='__main__', testRunner=None, ... with a custom testRunner that is already written to run unittest. Therefore we can more easily just run any args provided and then also gives users more flexibility. This change is similar in design to that of adding Django support with the use of the testRunner argument.

Looking for community input on useful this change is. Additionally the issues I think it would help with are as follows:

@eleanorjboyd eleanorjboyd added feature-request Request for new features or functionality needs proposal Need to make some design decisions needs community feedback Awaiting community feedback labels Oct 30, 2023
@eleanorjboyd eleanorjboyd self-assigned this Oct 30, 2023
@github-actions
Copy link

Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

@brettcannon
Copy link
Member

Thank you for submitting your feature request and everyone who considered it! Unfortunately, this issue did not receive enough votes over the allotted time, and so we are closing the issue.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2024
@github-actions github-actions bot removed needs community feedback Awaiting community feedback needs proposal Need to make some design decisions labels Jan 11, 2024
@eleanorjboyd
Copy link
Member Author

This will be required for switching to using Django so it will be a step as we implement that change.

@eleanorjboyd eleanorjboyd reopened this Jan 25, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 25, 2024
@eleanorjboyd eleanorjboyd added needs proposal Need to make some design decisions and removed feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team labels Jan 25, 2024
@carltongibson
Copy link

This is basically the main missing element in the Django support.

Django being quite a large Python web framework, it seems in everyone's interest to add this.

I'm not sure if anyone in the Django community was aware there was an issue to show support for, or that there was a time limit for it to be voted on, but I'm glad it's been reopened. I don't know if Code has any community outreach but that would have been handy: there are lots of Django folks using it.

👍

@iamoeg
Copy link

iamoeg commented Feb 2, 2024

Also a Django user, and I second @carltongibson's comment. Please push this forward.

@eleanorjboyd
Copy link
Member Author

Hi! This is a priority for us but is blocked on some work we have to do related to custom arguments which will enable setting the django variables required to use manage.py. The main issue which tracks this work and our proposed design can be found here: #22206 but it is based off a historical issue #73 with the request. It is the most highly voted feature on a repo so it is a priority for us and we are working to get there. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing needs proposal Need to make some design decisions
Projects
None yet
Development

No branches or pull requests

4 participants