Skip to content

Commit

Permalink
fix conftest typing; bump build actions
Browse files Browse the repository at this point in the history
  • Loading branch information
steersbob committed Feb 13, 2024
1 parent 2340bd1 commit 87b990a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Get image metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE }}

- name: ghcr.io login
uses: docker/login-action@v2
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
Expand All @@ -53,7 +53,7 @@ jobs:
poetry run invoke build
- name: Build Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
8 changes: 4 additions & 4 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import asyncio
import logging
from collections.abc import Generator
from pathlib import Path
from typing import AsyncGenerator, Generator

import pytest
from asgi_lifespan import LifespanManager
Expand Down Expand Up @@ -56,7 +56,7 @@ def config(monkeypatch: pytest.MonkeyPatch,
cfg = TestConfig(
debug=True,
mqtt_host='localhost',
mqtt_port=docker_services.port_for('mqtt', 1883),
mqtt_port=docker_services.port_for('eventbus', 1883),
redis_host='localhost',
redis_port=docker_services.port_for('redis', 6379),
victoria_host='localhost',
Expand Down Expand Up @@ -101,7 +101,7 @@ def app() -> FastAPI:


@pytest.fixture
async def manager(app: FastAPI) -> Generator[LifespanManager, None, None]:
async def manager(app: FastAPI) -> AsyncGenerator[LifespanManager, None]:
"""
AsyncClient does not automatically send ASGI lifespan events to the app
https://asgi.readthedocs.io/en/latest/specs/lifespan.html
Expand All @@ -115,7 +115,7 @@ async def manager(app: FastAPI) -> Generator[LifespanManager, None, None]:


@pytest.fixture
async def client(app: FastAPI, manager: LifespanManager) -> Generator[AsyncClient, None, None]:
async def client(app: FastAPI, manager: LifespanManager) -> AsyncGenerator[AsyncClient, None]:
"""
The default test client for making REST API calls.
Using this fixture will also guarantee that lifespan startup has happened.
Expand Down
2 changes: 1 addition & 1 deletion test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
mqtt:
eventbus:
image: ghcr.io/brewblox/mosquitto:develop
ports:
- "1883"
Expand Down

0 comments on commit 87b990a

Please sign in to comment.