Skip to content

Run tests with pytest instead of nose #107

Run tests with pytest instead of nose

Run tests with pytest instead of nose #107

Workflow file for this run

name: django-cte tests
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
django:
- 'Django>=4.2,<4.3'
- 'Django>=5.0,<5.1'
- 'Django>=5.1,<5.2'
exclude:
- {python: '3.9', django: 'Django>=5.0,<5.1'}
- {python: '3.9', django: 'Django>=5.1,<5.2'}
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Setup
run: |
python --version
pip install --upgrade pip wheel
pip install "${{ matrix.django }}" psycopg2-binary pytest-unmagic flake8
- name: Run tests
env:
DB_SETTINGS: >-
{
"ENGINE":"django.db.backends.postgresql_psycopg2",
"NAME":"django_cte",
"USER":"postgres",
"PASSWORD":"postgres",
"HOST":"localhost",
"PORT":"5432"
}
run: pytest -v
- name: Check style
run: flake8 django_cte/ tests/