-
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
Pytest Discovery does nothing when python.testing.cwd is set #22504
Comments
Happy to see this reported as I'm also suddenly experiencing this issue as well: BUT |
Hello! I have just returned from vacation and will take a look at this shortly, thank you for your patience! |
able to repro- will investigate! |
@eleanorjboyd any progress? |
@dmakhno, I took a look and it seems that if you specify your cwd as |
@ivan-the-terrible, it seems like your issue might be different since you aren't specifying a cwd. If you could open a new issue I can help you there. Thanks |
actually I am going to reopen this, there should be some sort of error message to signal the incorrect cwd is the problem. Will investigate that, thanks |
@eleanorjboyd I need some time to check. |
@eleanorjboyd encountering the same error after latest update of vscode, this is my
And this is the pytest discovery output from vscode:
|
Thanks @AndreasHaure! |
@eleanorjboyd,
"python.testing.cwd": "./pytest_issue" WA - Does not work! Some tiny anomaly I see, if I just start/restart vscode - discovery pretend to start.
And no more. But when I run "Test: Refresh Tests" command. Absolutely nothing
It happens for both cwd with/wo dot. |
Hi @dmakhno, sorry it isn't working still. This is the project I made to test it, let me know how yours differs. You could also try my project on your machine and see if that works. |
@eleanorjboyd, yep it is the same. Thanks! I found what was wrong for me. Hope following make sense for you. I wonder why first discovery atempt makes such effect? (shrug) Checked on full size project, WA works. After proper setting of Some minor observation.
cwd is resolved to full path Local - your project (darwin):
cwd stays relative. |
ah yes this makes sense "After proper setting of cwd need vscode restart. "Refresh Tests" is useless.", I am looking into why the extension doesn't error out but it has a behavior where if discovery is already running it will not run again even with new args because discovery is expensive. As I work to figure out how to get the extension to error out on the wrong cwd I had added some logging to notify the user that discovery is not being re-run, hopefully this will help the next user. Sorry for the difficulty! a05dee8 |
Yeah I think I might running up against the fact that discovery doesn't rerun and reopening VSCode helped as it was able to be rediscovered after some attempts. I'm not entirely sure... But I downloaded the sample project you created and get the same error on Windows (running VSCode v1.85.1). Setting the |
Hey @eleanorjboyd, this issue might need further attention. @dmakhno, you can help us out by closing this issue if the problem no longer exists, or adding more information. |
@eleanorjboyd, github-actions is worried that something is needed. :-) Lookiing forward for:
|
Type: Bug
Behaviour
Expected vs. Actual
Expect pytest discovery can found tests. And if not - reports what is wrong.
Steps to reproduce:
create workspace-folder | create workspace with folder (I checked both, thinking of Overload methods testing rewrite #21082 python.testing.pytestEnabled isn't respected for discovery #22218)
inside any folder create
pytest_issue
inside pytest_issue/test_foo.py with any test, e.g.
def test_foo(): ...
.ensure config for workspace or folder:
nothing. :(
No steps further of:
vscode-python/src/client/testing/testController/controller.ts
Line 271 in f6cfa6e
As soon as I delete
python.testing.cwd
, it starts working. (But my real env needspython.testing.cwd
, so no WA)If I
Reload Window
, I got:In other times to
--collect-only
no calls. Silence.Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.20.0
VS Code version: Code 1.84.2 (Universal) (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:52:33.687Z)
OS version: Darwin arm64 23.1.0
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: