Skip to content

Commit

Permalink
Use sys.executable instead of "python".
Browse files Browse the repository at this point in the history
This is a silly PR meant to test some of the newly activated code analysis tools.
Despite being minor, it still is useful
  • Loading branch information
tovrstra committed Jun 3, 2024
1 parent ccb1d92 commit ddd9332
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions iodata/test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import functools
import os
import subprocess
import sys

from numpy.testing import assert_allclose, assert_equal

Expand Down Expand Up @@ -55,15 +56,16 @@ def test_convert_one_manfmt(tmpdir):

def test_script_one_autofmt(tmpdir):
def myconvert(infn, outfn):
subprocess.run(["python", "-m", "iodata.__main__", infn, outfn], check=True)
subprocess.run([sys.executable, "-m", "iodata.__main__", infn, outfn], check=True)

_check_convert_one(myconvert, tmpdir)


def test_script_one_manfmt(tmpdir):
def myconvert(infn, outfn):
subprocess.run(
["python", "-m", "iodata.__main__", infn, outfn, "-i", "fchk", "-o", "xyz"], check=True
[sys.executable, "-m", "iodata.__main__", infn, outfn, "-i", "fchk", "-o", "xyz"],
check=True,
)

_check_convert_one(myconvert, tmpdir)
Expand Down Expand Up @@ -94,15 +96,15 @@ def test_convert_many_manfmt(tmpdir):

def test_script_many_autofmt(tmpdir):
def myconvert(infn, outfn):
subprocess.run(["python", "-m", "iodata.__main__", infn, outfn, "-m"], check=True)
subprocess.run([sys.executable, "-m", "iodata.__main__", infn, outfn, "-m"], check=True)

_check_convert_many(myconvert, tmpdir)


def test_script_many_manfmt(tmpdir):
def myconvert(infn, outfn):
subprocess.run(
["python", "-m", "iodata.__main__", infn, outfn, "-m", "-i", "fchk", "-o", "xyz"],
[sys.executable, "-m", "iodata.__main__", infn, outfn, "-m", "-i", "fchk", "-o", "xyz"],
check=True,
)

Expand Down

0 comments on commit ddd9332

Please sign in to comment.