-
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
Test classes no longer work with pytest 6.2.5 #22457
Comments
I had the same symptoms. |
You can opt out of the |
Sorry, I figured out the problem. The plugin no longer works with pytest 6.2.5. Updating to the latest version fixed. Updating the issue. |
Hi @matthew-mcallister, to clarify does it now work with the extension after updating or does this problem still exist? Thanks |
@eleanorjboyd I meant the issue is fixed by updating to the latest version of pytest, 7.4.3. The issue still exists in the latest version of the vscode extension. |
the root cause for the issue is the plugin no longer works with pytest 6.2.5 right? If so then that seems like a pytest issue and not an extension issue. Or are you suggesting the issue is that we should have better error reporting? |
Yes, the issue is that the plugin is incompatible with pytest 6.2.5; this is a breaking change to the plugin. What to do about that is up to the maintainers to decide. Either the extension should continue to work with older versions of pytest to maintain compatibility, or there should be a version check and an error report letting the user know that their version of pytest is not compatible. That way users do not need to grapple with a mysterious bug. |
@karthiknadig what are you thoughts on the best way to check what version of pytest a user is on and provide an error message as a result? |
seems like pytest 6.2.5 is still supported and that only versions below 4.6 are no longer supported. This means I should support pytest 6.2.5. Will investigate how to do so |
FWIW, there are three ways (that I'm aware of) to find out what pytest version is installed. In order of preference, best first, they are:
|
Hello! Just as an update here I discussed with the pytest developers: pytest-dev/pytest#12253 and agree with their assessment that pytest 7.0.0 should be the lowest version we will support in the extension at this time. I will update the docs to reflect that, thanks |
Behaviour
Expected vs. Actual
This bug occurs with pytest version 6.2.5. All tests should be visible in the Test Explorer, with classes (e.g.
class TestWidget
) appearing as nested levels in the hierarchy.However, if a test class is present (or multiple test classes), all other tests are hidden except for the tests in that class.
Steps to reproduce:
test_example.py
with the following text:TestExample
, then test_one becomes visible again.Diagnostic data
python.languageServer
setting: PylanceOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
The text was updated successfully, but these errors were encountered: