installable package (#9)
* turn repo into installable package (pip install -e .) * add hatchling build packend * call it pytest-abra * add pytest entrypoint, so that it gets loaded automatically if installed (and pytest is run) * make fixtures optional, so that pytest can still be used in other context * add cli script -> you can now directly run "pytest-abra" in console Reviewed-on: local-it-infrastructure/e2e_tests#9 Co-authored-by: Daniel <d.brummerloh@gmail.com> Co-committed-by: Daniel <d.brummerloh@gmail.com>
This commit is contained in:
parent
4c5a470a70
commit
8685688698
33 changed files with 294 additions and 210 deletions
17
prototyping/env_var_subprocess.py
Normal file
17
prototyping/env_var_subprocess.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
# Set an environment variable in the parent process
|
||||
os.environ["PARENT_VARIABLE"] = "12345s"
|
||||
|
||||
# Spawn a subprocess and modify the environment variable
|
||||
subprocess.run(
|
||||
[
|
||||
"python",
|
||||
"-c",
|
||||
"import os; print('b', os.environ['PARENT_VARIABLE']); os.environ['PARENT_VARIABLE'] = 'modified_value'; print('c', os.environ['PARENT_VARIABLE'])",
|
||||
]
|
||||
)
|
||||
|
||||
# Check if the modification in the subprocess affected the parent process
|
||||
print("a", os.environ["PARENT_VARIABLE"]) # This will print 'parent_value', not 'modified_value'
|
||||
Loading…
Add table
Add a link
Reference in a new issue