def test_system(self): filename = str(udir.join('test_system.txt')) arg = '%s -c "print 1+1" > %s' % (sys.executable, filename) data = rposix.system(arg) assert data == 0 assert file(filename).read().strip() == '2' os.unlink(filename)