Skip to content

How to run some environment setting cmd before pytest in VSCode #20163

Answered by brettcannon
shaoqx asked this question in Q&A
Discussion options

You must be logged in to vote

Not specifically. Can you run the commands before you load VS Code? Otherwise you can try to use a debugging configuration to tweak things and run your tests under a debugger. The last option I can think of is specifying a different script for the path to pytest and have that do the loading for you.

Beyond that the only thing I can think of is using something like subprocess to run the command for you (assuming it doesn't need to set environment variables).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@shaoqx
Comment options

@brettcannon
Comment options

Answer selected by shaoqx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants