How to run unit tests as sudo?
I have seen other threads that have been told to create a new interpreter.
I have done this
PythonSudo.sh
However my Source Roots are not included and the tests fail when importing my modules
How can this be fixed? Or is there now a better way to run tests as sudo?
I have done this
PythonSudo.sh
#!/bin/sh #Python Interpreter for running tests as root # user needs sudo NOPASSWD enabled sudo python "$@"
However my Source Roots are not included and the tests fail when importing my modules
How can this be fixed? Or is there now a better way to run tests as sudo?
Please sign in to leave a comment.
Sudo loses PythonPath, this fixes it.