Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_redirected_stream():
sys.stderr = io.StringIO()
with cppimport.build_module.stdchannel_redirected("stdout") as s:
with cppimport.build_module.stdchannel_redirected("stderr"):
print("EEEP!")
assert(s.getvalue() == 'EEEP!\n')
def test_redirected_stream():
sys.stderr = io.StringIO()
with cppimport.build_module.stdchannel_redirected("stdout") as s:
with cppimport.build_module.stdchannel_redirected("stderr"):
print("EEEP!")
assert(s.getvalue() == 'EEEP!\n')