microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.34k stars 1.19k forks source link

Check auto refresh setting during pytest discovery #24117

Open rchiodo opened 2 months ago

rchiodo commented 2 months ago

I'm working on some code that uses Cython for optimizations. Every time I regen the Cython output, I get an error that it can't create the pyd files. This is because every time I change the python code, the test discovery runs.

It would be nice if there was a way to make test discovery have a manual refresh instead of auto refresh.

karthiknadig commented 2 months ago

Unsetting this should stop it. image

rchiodo commented 2 months ago

Closing? Seems like my request was already possible, I just didn't know about the setting.

rchiodo commented 2 months ago

I looked for a command to enable/disable it. I should have looked in the settings too.

rchiodo commented 2 months ago

Reopening. It doesn't seem to work. I still get a refresh. Do I need to reload VS code for this to work?

karthiknadig commented 2 months ago

@rchiodo Yes. The events are added on load I think.

@eleanorjboyd This could be something that we can make more configurable. i.e, we can ignore the events when setting is disabled?

eleanorjboyd commented 1 month ago

@karthiknadig are you saying that the setting should be more responsive and not require and reload on vscode to work?

karthiknadig commented 1 month ago

In the handler for files modified, we can check if this setting is disabled.