Skip to content

Commit

Permalink
Use sys.executable rather than "python" to invoke pytest
Browse files Browse the repository at this point in the history
This supports environments where the Python interpreter is not named
"python". For example, in Fedora it is "python3" unless the
python-unversioned-command package is installed.
  • Loading branch information
musicinmybrain authored and 15r10nk committed Jan 2, 2025
1 parent 951c465 commit ae7ff58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/inline_snapshot/testing/_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import platform
import re
import subprocess as sp
import sys
import traceback
from argparse import ArgumentParser
from io import StringIO
Expand Down Expand Up @@ -262,7 +263,7 @@ def run_pytest(
tmp_path = Path(dir)
self._write_files(tmp_path)

cmd = ["python", "-m", "pytest", *args]
cmd = [sys.executable, "-m", "pytest", *args]

term_columns = 80

Expand Down

0 comments on commit ae7ff58

Please sign in to comment.