@@ -1,3 +1,4 @@
+import pathlib
import shutil
import subprocess
@@ -7,15 +8,15 @@ import tooncher
def test_start_engine():
- p = tooncher.start_engine(
+ process = tooncher.start_engine(
- engine_path=shutil.which("printenv"),
+ engine_path=pathlib.Path(shutil.which("printenv")),
gameserver="gameserver",
playcookie="cookie",
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
- assert isinstance(p, subprocess.Popen)
+ assert isinstance(process, subprocess.Popen)
- stdout, stderr = p.communicate()
+ stdout, stderr = process.communicate()
assert b"" == stderr
env = stdout.strip().split(b"\n")
assert b"TTR_GAMESERVER=gameserver" in env
@@ -39,7 +39,7 @@ def start_engine(
# > Exception: Could not open window.
env["XAUTHORITY"] = os.environ["XAUTHORITY"]
return subprocess.Popen(
- args=[str(engine_path)], cwd=engine_path.parent(), env=env, **popen_kwargs,
+ args=[str(engine_path)], cwd=engine_path.parent, env=env, **popen_kwargs,