Skip to content

Commit 263d561

Browse files
authored
Merge pull request #22 from neo4j-labs/fix-pytest
fix: add pytest package to inner invocation
2 parents 205381c + 7f15460 commit 263d561

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tests/test_generated_tests.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ def test_generated_tests_discoverable(self, tmp_path):
8989
f"pip install failed:\nstdout: {result.stdout}\nstderr: {result.stderr}"
9090
)
9191

92+
# Install pytest into the isolated venv (needed to run generated tests)
93+
result = subprocess.run(
94+
["uv", "pip", "install", "pytest"],
95+
env=env,
96+
capture_output=True,
97+
text=True,
98+
timeout=120,
99+
)
100+
assert result.returncode == 0, (
101+
f"pytest install failed:\nstdout: {result.stdout}\nstderr: {result.stderr}"
102+
)
103+
92104
# Collect tests without running them
93105
result = subprocess.run(
94106
[str(venv_dir / "bin" / "python"), "-m", "pytest", "--collect-only", "tests/"],
@@ -156,6 +168,18 @@ def test_generated_tests_pass(self, tmp_path, framework):
156168
f"stdout: {result.stdout}\nstderr: {result.stderr}"
157169
)
158170

171+
# Install pytest into the isolated venv (needed to run generated tests)
172+
result = subprocess.run(
173+
["uv", "pip", "install", "pytest"],
174+
env=env,
175+
capture_output=True,
176+
text=True,
177+
timeout=120,
178+
)
179+
assert result.returncode == 0, (
180+
f"pytest install failed:\nstdout: {result.stdout}\nstderr: {result.stderr}"
181+
)
182+
159183
# Run the generated tests
160184
result = subprocess.run(
161185
[str(venv_dir / "bin" / "python"), "-m", "pytest", "tests/", "-v"],

0 commit comments

Comments
 (0)