Skip to content

added env var to tell other code when it's running under testflo#64

Merged
swryan merged 1 commit intoOpenMDAO:masterfrom
naylor-b:testflo_running_env
Feb 14, 2022
Merged

added env var to tell other code when it's running under testflo#64
swryan merged 1 commit intoOpenMDAO:masterfrom
naylor-b:testflo_running_env

Conversation

@naylor-b
Copy link
Member

This change was originally in the PR that updates coverage, but that PR is held up because of some issue I haven't had time to look into yet. But Herb needs this now so I'm just splitting it out into its own PR.

return True
return False

# set this so code will know when it's running under testflo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you restore the env var after testflo finishes? (Or is this being set on the spawned processes?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable appears not to persist even if not explicitly removed. For example, for this python code

import os
os.environ['FOOBAZ'] = '1'
print("FOOBAZ =", os.environ.get('FOOBAZ'))

After running this code and checking the current environment, FOOBAZ isn't found.

@swryan swryan merged commit 03dc435 into OpenMDAO:master Feb 14, 2022
@naylor-b naylor-b deleted the testflo_running_env branch February 14, 2022 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants