pytest-subprocess icon indicating copy to clipboard operation
pytest-subprocess copied to clipboard

check env of subprocess

Open raylu opened this issue 2 years ago • 1 comments
trafficstars

I have some code along the lines of

subprocess.run(['thing'], env={'KEY': some_carefully_constructed_value()})

I can fake_process.register_subprocess(['thing']) but there doesn't appear to be a way to check the env that was passed to the process

I also had

subprocess.run(f'KEY={some_carefully_constructed_value()} thing', shell=True)

but I couldn't find a way to grab that either

raylu avatar Oct 14 '23 00:10 raylu

Thanks for reporting, you're right - there's no way to get that information as original arguments for Popen are not preserved anywhere. I don't know when I'll have a time to work on it, feel free to submit a PR if you want.

aklajnert avatar Oct 14 '23 14:10 aklajnert