Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests when run locally on Windows/venv
  • Loading branch information
spyoungtech committed May 4, 2023
commit 415991bffb445bdaa332861e803d61c5371d2844
11 changes: 6 additions & 5 deletions tests/test_unasync.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import shutil
import subprocess
import sys

import pytest

Expand Down Expand Up @@ -69,9 +70,9 @@ def test_build_py_modules(tmpdir):

env = copy.copy(os.environ)
env["PYTHONPATH"] = os.path.realpath(os.path.join(TEST_DIR, ".."))
subprocess.check_call(["python", "setup.py", "build"], cwd=mod_dir, env=env)
subprocess.check_call([sys.executable, "setup.py", "build"], cwd=mod_dir, env=env)
# Calling it twice to test the "if not copied" branch
subprocess.check_call(["python", "setup.py", "build"], cwd=mod_dir, env=env)
subprocess.check_call([sys.executable, "setup.py", "build"], cwd=mod_dir, env=env)

unasynced = os.path.join(mod_dir, "build/lib/_sync/some_file.py")
tree_build_dir = list_files(mod_dir)
Expand All @@ -88,7 +89,7 @@ def test_build_py_packages(tmpdir):

env = copy.copy(os.environ)
env["PYTHONPATH"] = os.path.realpath(os.path.join(TEST_DIR, ".."))
subprocess.check_call(["python", "setup.py", "build"], cwd=pkg_dir, env=env)
subprocess.check_call([sys.executable, "setup.py", "build"], cwd=pkg_dir, env=env)

unasynced = os.path.join(pkg_dir, "build/lib/example_pkg/_sync/__init__.py")

Expand All @@ -104,7 +105,7 @@ def test_project_structure_after_build_py_packages(tmpdir):

env = copy.copy(os.environ)
env["PYTHONPATH"] = os.path.realpath(os.path.join(TEST_DIR, ".."))
subprocess.check_call(["python", "setup.py", "build"], cwd=pkg_dir, env=env)
subprocess.check_call([sys.executable, "setup.py", "build"], cwd=pkg_dir, env=env)

_async_dir_tree = list_files(
os.path.join(source_pkg_dir, "src/example_pkg/_async/.")
Expand All @@ -123,7 +124,7 @@ def test_project_structure_after_customized_build_py_packages(tmpdir):

env = copy.copy(os.environ)
env["PYTHONPATH"] = os.path.realpath(os.path.join(TEST_DIR, ".."))
subprocess.check_call(["python", "setup.py", "build"], cwd=pkg_dir, env=env)
subprocess.check_call([sys.executable, "setup.py", "build"], cwd=pkg_dir, env=env)

_async_dir_tree = list_files(os.path.join(source_pkg_dir, "src/ahip/."))
unasynced_dir_path = os.path.join(pkg_dir, "build/lib/hip/.")
Expand Down