First time here? Check out the FAQ!
1

activate virtualenv in test script

  • retag add tags

In a project with no virtualenv activated I am testing python script to activate virtual env. Creation and activation are done using subprocess to call bash scripts.

I cannot get the virtual env to be activated, that is the VIRTUAL_ENV environment variable to be set. Is this deviant usage of wing?

I guess I can find a turn around with mocks. I would just like to know!...

piscvau's avatar
526
piscvau
asked 2022-08-05 16:49:33 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

In general the way to activate a virtualenv for a debug or test process, or for the Python Shell, is to set the Python Executable to Activated Env and specify the full path to the activation script. This can either be in Project Properties under the Environment tab or in a Launch Configuration created from the Project menu.

If your tests use a different env than your project in general, you would need to create a launch configuration and either use it in the Environment in the Testing tab of Project Properties (for all tests) or in the File Properties on a specific test file (if just one test file is using that env).

Some relevant docs:

Please don't hesitate to ask if this isn't clear.

Wingware Support's avatar
4.1k
Wingware Support
answered 2022-08-05 18:40:24 -0500, updated 2022-08-05 18:41:24 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer