@py.test.mark.skipif('sys.version_info < (2, 6)') def test_dont_write_bytecode(self, makegateway): check_sys_dont_write_bytecode = """ import sys channel.send(sys.dont_write_bytecode) """
gw = makegateway('popen') channel = gw.remote_exec(check_sys_dont_write_bytecode) ret = channel.receive() assert not ret gw = makegateway('popen//dont_write_bytecode') channel = gw.remote_exec(check_sys_dont_write_bytecode) ret = channel.receive() assert ret
Long story short, this test assumes that bytecode compiling is enabled unless explicitly disabled in the
makegateway() call. Therefore, it fails when the tests are run with
PYTHONDONTWRITEBYTECODE environment variable set and bytecode compiling is disabled in both cases.
I'm not sure how to fix this. I'm not sure if enabling bytecode compiling when user disabled it is a good idea. Another solution would be to skip the test if bytecode compiling is disabled in the parent process.