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 committed Dec 22, 2024
1 parent c8a26c2 commit 1d0168b
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 @@ -263,7 +264,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 1d0168b

Please sign in to comment.