import pathlib import shutil import subprocess import mwe def test_python(): assert mwe.add(1, 2) == 3 def test_executable(): mwe = shutil.which("mwe.exe") assert mwe is not None expected = pathlib.Path(__file__).parent.parent / "env" / "bin" / "mwe.exe" assert mwe == str(expected.resolve()) proc = subprocess.run([mwe, "1", "2"], check=True, text=True, capture_output=True) assert proc.stdout.strip() == "1 + 2 = 3"