Skip to content

Commit 475c8bc

Browse files
alimcmaster1jorisvandenbossche
authored andcommitted
Fix tests fragile to PATH (#21453)
(cherry picked from commit 7a49449)
1 parent 1917671 commit 475c8bc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pandas/tests/plotting/test_converter.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import subprocess
2+
import sys
23
import pytest
34
from datetime import datetime, date
45

@@ -27,7 +28,7 @@ def test_register_by_default(self):
2728
"import pandas as pd; "
2829
"units = dict(matplotlib.units.registry); "
2930
"assert pd.Timestamp in units)'")
30-
call = ['python', '-c', code]
31+
call = [sys.executable, '-c', code]
3132
assert subprocess.check_call(call) == 0
3233

3334
def test_warns(self):

pandas/tests/test_downstream.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Testing that we work in the downstream packages
44
"""
55
import subprocess
6+
import sys
67

78
import pytest
89
import numpy as np # noqa
@@ -57,7 +58,7 @@ def test_xarray(df):
5758

5859
def test_oo_optimizable():
5960
# GH 21071
60-
subprocess.check_call(["python", "-OO", "-c", "import pandas"])
61+
subprocess.check_call([sys.executable, "-OO", "-c", "import pandas"])
6162

6263

6364
@tm.network

0 commit comments

Comments
 (0)