[e988c2]: / tests / functional / test_entrypoint.py

Download this file

21 lines (17 with data), 535 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
import os.path
import subprocess
import sys
def test_entrypoint():
# Include the Python executable directory on the path so that even if the virtualenv
# isn't activated we can still find the `ehrql` executable.
path = os.pathsep.join(
[os.path.dirname(sys.executable), os.environ.get("PATH", "")]
)
result = subprocess.run(
["ehrql", "--help"],
capture_output=True,
text=True,
check=True,
env={"PATH": path},
)
assert "usage: ehrql [-h]" in result.stdout