Skip to content

Commit

Permalink
test: Try changing Python path
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Jul 20, 2024
1 parent b5db2aa commit 91b8380
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
cache-dependency-path: setup.py
- run: pip install -e .[test]
- if: matrix.python-version != 'pypy-3.9' || matrix.os != 'windows-latest'
run: pytest tests --cov scrapyd
run: python -m pytest tests --cov scrapyd
- if: matrix.python-version != 'pypy-3.9' || matrix.os != 'macos-latest'
name: Run integration tests
run: |
printf "[scrapyd]\nusername = hello12345\npassword = 67890world\n" > scrapyd.conf
mkdir logs
scrapyd > scrapyd.log 2>&1 &
sleep 1
pytest integration_tests
python -m pytest integration_tests
cat scrapyd.log
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[tool.pytest.ini_options]
pythonpaths = ["."]

[tool.ruff]
line-length = 119
target-version = "py38"
Expand Down
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

import pytest
from twisted.web import http
from twisted.web.http import Request
Expand All @@ -19,6 +21,7 @@ def txrequest():
# Use this fixture when testing the Scrapyd web UI or API or writing configuration files.
@pytest.fixture()
def chdir(monkeypatch, tmpdir):
print(sys.path) # noqa: T201 for debugging in CI
return monkeypatch.chdir(tmpdir)


Expand Down
4 changes: 2 additions & 2 deletions tests/mockserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class MockScrapydServer:
def __init__(self, authentication=None):
self.authentication = authentication

def __enter__(self, authentication=None):
"""Launch Scrapyd application object with ephemeral port"""
def __enter__(self):
print(sys.path) # noqa: T201 for debugging in CI
command = [sys.executable, "-m", "tests.start_mock_app", get_ephemeral_port()]
if self.authentication is not None:
command.append("--auth=" + self.authentication)
Expand Down

0 comments on commit 91b8380

Please sign in to comment.