Skip to content

Commit

Permalink
get python interpreter from sys in test
Browse files Browse the repository at this point in the history
  • Loading branch information
rbeucher committed May 24, 2022
1 parent 34fd008 commit c466c31
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/pytests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import pytest
import glob
import ntpath
import sys

scripts = [pytest.param(path, id=ntpath.basename(path)) for path in sorted(glob.glob("docs/test/*.py"))]

@pytest.mark.parametrize('script', scripts)
def test_script_execution(script):
subprocess.run(["python", script])
subprocess.run([sys.executable, script])
3 changes: 2 additions & 1 deletion docs/pytests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import pytest
import glob
import ntpath
import sys

scripts = [pytest.param(path, id=ntpath.basename(path)) for path in sorted(glob.glob("docs/examples/*.py"))]

@pytest.mark.parametrize('script', scripts)
def test_script_execution(script):
subprocess.run(["python", script])
subprocess.run([sys.executable, script])
3 changes: 2 additions & 1 deletion docs/pytests/test_user_guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import pytest
import glob
import ntpath
import sys

scripts = [pytest.param(path, id=ntpath.basename(path)) for path in sorted(glob.glob("docs/user_guide/*.py"))]

@pytest.mark.parametrize('script', scripts)
def test_script_execution(script):
subprocess.run(["python", script])
subprocess.run([sys.executable, script])

0 comments on commit c466c31

Please sign in to comment.