You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
allow usage of unittest's load_tests protocol in python unit tests #12063
In order to make the second test succeed I need to run some code before it. I do this by using unittest's load_test protocol. It is implemented in tests/__init__.py:
If I run python -m unittest from the root dir, everything works fine:
..
----------------------------------------------------------------------
Ran 2 tests in 0.001s
OK
I could not manage to use my custom test suite within the vs code python extension. If there is currently no solution, I would like to request this feature.
I am aware of other solutions like using setUp per test or module for this simple example. However in my real project the setup involves more complex steps like initializing an email server.
Thank you for the suggestion! We have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision.
As an update here, I am going to have to rewrite a bit of how unittest works to allow for django complatibility. When I do so, I will switch to calling unittest more generally (instead of recreating the steps unittest takes). With this change this issue should be resolved as well (or at least make sure this use case is also taken care of during that other engineering work). #73
Activity
karthiknadig commentedon Jun 2, 2020
Thank you for the suggestion! We have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision.
eleanorjboyd commentedon Dec 20, 2023
As an update here, I am going to have to rewrite a bit of how unittest works to allow for django complatibility. When I do so, I will switch to calling unittest more generally (instead of recreating the steps unittest takes). With this change this issue should be resolved as well (or at least make sure this use case is also taken care of during that other engineering work). #73
edit, this issue better describes this: #22388