Skip to content

Commit

Permalink
WIP: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pajod committed Dec 26, 2023
1 parent cc7659b commit 3d32831
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
python-version: [ "3.10" ]
os: ["ubuntu-latest"]
include:
- os: ubuntu-latest
python-version: "3.12"
toxenv: null
- os: windows-latest
python-version: "3.12"
toxenv: format
Expand All @@ -34,18 +37,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Using Python ${{ matrix.python-version }}
if: ${{ matrix.toxenv }}
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "Install Dependencies (cache hit: ${{ steps.setup-python.outputs.cache-hit }})"
if: ${{ matrix.toxenv }}
run: |
python -m pip install --upgrade pip
python -m pip install tox
- run: tox -e ${{ matrix.toxenv }}
if: ${{ matrix.toxenv }}
- name: "Lint support files"
if: ${{ ! matrix.toxenv }}
name: "Lint support files"
env:
# annoying results for pl_PL and fr_FR.. still the oly *obvious* choice
LC_ALL: C
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ jobs:
- os: ubuntu-20.04
python-version: "3.8"
mindep: true
unsupported: false
- os: ubuntu-latest
python-version: "3.13"
unsupported: true
mindep: false
- os: windows-latest
python-version: "3.12"
unsupported: true
mindep: false
exclude:
# skip some dupes on slower platform
- os: macos-latest
Expand Down
3 changes: 2 additions & 1 deletion gunicorn/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def get_dependency_version(package_name):
try:
from gunicorn.packaging_support import _dependency_error
return _dependency_error(package_name)
except Exception:
except Exception as ex:
print(ex, file=sys.stderr)
warnings.warn(
"gunicorn.packaging_support unavailale "
"- unmet dependencies will not produce nice tracebacks",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ omit = [
[tool.pytest.ini_options]
minversion = "7.2.0"
# seconds until still-running tests are dumped
faulthandler_timeout = 20
faulthandler_timeout = 25
norecursedirs = ["examples", "lib", "local", "src"]
testpaths = ["tests/"]
# --assert=plain stops rewriting asserts for better expression info
Expand Down
6 changes: 3 additions & 3 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,14 @@ def test_process_request_after_syntax_error():
assert "error" in body.lower()

access_log = server._read_stdio(
key=OUT, wait_for_keyword='GET / HTTP/1.1" 500 ', timeout_sec=3
key=OUT, wait_for_keyword='GET / HTTP/1.1" 500 ', timeout_sec=5
)
# trigger reloader
server.write_ok()
# os.utime(editable_file)

reload_log = server._read_stdio(
key=ERR, wait_for_keyword="reloading", timeout_sec=3
key=ERR, wait_for_keyword="reloading", timeout_sec=5
)
assert ("%s.py modified" % APP_BASENAME) in reload_log
assert "Booting worker" in reload_log
Expand All @@ -202,7 +202,7 @@ def test_process_request_after_syntax_error():
assert "response body from app" == body

debug_log = server._read_stdio(
key=ERR, wait_for_keyword="stderr from app", timeout_sec=4
key=ERR, wait_for_keyword="stderr from app", timeout_sec=5
)

shutdown_log = server._graceful_quit()
Expand Down

0 comments on commit 3d32831

Please sign in to comment.