First time here? Check out the FAQ!
1

activate virtualenv in test script
 

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!...

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
piscvau's avatar
611
piscvau
asked 2 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.3k
Wingware Support
answered 2 years ago, updated 2 years ago
link

Comments

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)