Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix unit test failures by prioritizing current directory in PYTHONPATH (#10105)

Graham Neubig8416a019cb51
diff --git a/.github/workflows/py-tests.yml b/.github/workflows/py-tests.yml
index bf8bee17a1..60cdd80521 100644
--- a/.github/workflows/py-tests.yml
+++ b/.github/workflows/py-tests.yml
@@ -48,11 +48,11 @@ jobs:
- name: Build Environment
run: make build
- name: Run Unit Tests
- run: poetry run pytest --forked -n auto -svv ./tests/unit
+ run: PYTHONPATH=".:$PYTHONPATH" poetry run pytest --forked -n auto -svv ./tests/unit
- name: Run Runtime Tests with CLIRuntime
- run: TEST_RUNTIME=cli poetry run pytest -svv tests/runtime/test_bash.py
+ run: PYTHONPATH=".:$PYTHONPATH" TEST_RUNTIME=cli poetry run pytest -svv tests/runtime/test_bash.py
- name: Run E2E Tests
- run: poetry run pytest -svv tests/e2e
+ run: PYTHONPATH=".:$PYTHONPATH" poetry run pytest -svv tests/e2e
# Run specific Windows python tests
test-on-windows:
@@ -77,9 +77,11 @@ jobs:
- name: Run Windows unit tests
run: poetry run pytest -svv tests/unit/test_windows_bash.py
env:
+ PYTHONPATH: ".;$env:PYTHONPATH"
DEBUG: "1"
- name: Run Windows runtime tests with LocalRuntime
run: $env:TEST_RUNTIME="local"; poetry run pytest -svv tests/runtime/test_bash.py
env:
+ PYTHONPATH: ".;$env:PYTHONPATH"
TEST_RUNTIME: local
DEBUG: "1"