intellij: TEST_SRCDIR is not set on environment during debugging.
for loading fixtures for tests (using pytest):
@fixture
def root_path():
if 'TEST_SRCDIR' in os.environ:
return os.environ['TEST_SRCDIR'] + "/" + os.environ[
'TEST_WORKSPACE'] + "/path/to/root"
else:
raise(Exception("Can not find fixtures, test setup incorrect"))
@fixture
def fixture_path(root_path):
return root_path + "/test/fixtures"
When running a running a test target, this works fine, but when debugging the environment variable TEST_SRCDIR is not set.
I believe TEST_SRCDIR should always be set for tests according to: https://docs.bazel.build/versions/master/test-encyclopedia.html
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 18 (9 by maintainers)
TEST_WORKSPACEis another that I wish were set to allow usage ofbazel.RunfilesPath()in go tests (breaks when we run with debugger due to this not being set).