Replace subprocess.check_call() with run()
@@ -702,14 +702,14 @@ class TestRunExecutor(unittest.TestCase):
self.check_exitcode(result, 0, "exit code of /bin/sh is not zero")
temp_dir = output[-1]
test_file = os.path.join(temp_dir, "test")
- subprocess.check_call(["test", "-f", test_file])
+ subprocess.run(["test", "-f", test_file], check=True)
self.assertEqual(
"tmp", os.path.basename(temp_dir), "unexpected name of temp dir"
)
self.assertNotEqual(
"/tmp", temp_dir, "temp dir should not be the global temp dir"
)
- subprocess.check_call(["rm", "-r", os.path.dirname(temp_dir)])
+ subprocess.run(["rm", "-r", os.path.dirname(temp_dir)], check=True)
def test_require_cgroup_invalid(self):
with self.assertLogs(level=logging.ERROR) as log:
