Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Joaquin Cruz committed Apr 11, 2022
2 parents 6c51fe3 + f27c6aa commit 8e5d13e
Show file tree
Hide file tree
Showing 62 changed files with 2,707 additions and 1,437 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ branch = 1
[report]
include = pytest_django/*,pytest_django_test/*,tests/*
skip_covered = 1
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
154 changes: 154 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: main

on:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- master

env:
PYTEST_ADDOPTS: "--color=yes"

# Set permissions at the job level.
permissions: {}

jobs:
test:
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.allow_failure }}
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Setup mysql
if: contains(matrix.name, 'mysql')
run: |
sudo systemctl start mysql.service
echo "TEST_DB_USER=root" >> $GITHUB_ENV
echo "TEST_DB_PASSWORD=root" >> $GITHUB_ENV
- name: Setup postgresql
if: contains(matrix.name, 'postgres')
run: |
sudo systemctl start postgresql.service
sudo -u postgres createuser --createdb $USER
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox==3.24.4
- name: Run tox
run: tox -e ${{ matrix.name }}

- name: Report coverage
if: contains(matrix.name, 'coverage')
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: ./coverage.xml

strategy:
fail-fast: false
matrix:
include:
- name: linting,docs
python: 3.8
allow_failure: false

- name: py310-dj40-postgres-xdist-coverage
python: '3.10'
allow_failure: false

- name: py310-dj32-postgres-xdist-coverage
python: '3.10'
allow_failure: false

- name: py39-dj32-postgres-xdist-coverage
python: 3.9
allow_failure: false

- name: py39-dj40-mysql_innodb-coverage
python: 3.9
allow_failure: false

- name: py36-dj22-sqlite-xdist-coverage
python: 3.6
allow_failure: false

- name: py37-dj22-sqlite-xdist-coverage
python: 3.7
allow_failure: false

- name: py38-dj32-sqlite-xdist-coverage
python: 3.8
allow_failure: false

- name: py38-dj40-sqlite-xdist-coverage
python: 3.8
allow_failure: false

- name: py39-djmain-sqlite-coverage
python: 3.9
allow_failure: true

# Explicitly test (older) pytest 5.4.
- name: py35-dj22-postgres-pytest54-coverage
python: 3.5
allow_failure: false

- name: py35-dj22-sqlite_file-coverage
python: 3.5
allow_failure: false

- name: py36-dj32-mysql_myisam-coverage
python: 3.6
allow_failure: false

# pypy3: not included with coverage reports (much slower then).
- name: pypy3-dj22-postgres
python: pypy3
allow_failure: false

deploy:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest-django'
runs-on: ubuntu-20.04
timeout-minutes: 15
permissions:
contents: read

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade build
- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.pypi_token }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ _build
.Python
.eggs
*.egg
# autogenerated by setuptools-scm
/pytest_django/_version.py
16 changes: 16 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

sphinx:
configuration: docs/conf.py

python:
version: 3
install:
- method: pip
path: .
extra_requirements:
- docs

formats:
- epub
- pdf
109 changes: 0 additions & 109 deletions .travis.yml

This file was deleted.

10 changes: 8 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Ben Firshman <ben@firshman.co.uk> created the original version of pytest-django.

This fork is currently maintained by Andreas Pelme <andreas@pelme.se>.
This project is currently maintained by Ran Benita <ran@unusedvar.com>.

Previous maintainers are:

Andreas Pelme <andreas@pelme.se>
Daniel Hahler <https://twitter.com/blueyed>

These people have provided bug fixes, new features, improved the documentation
or just made pytest-django more awesome:
Expand All @@ -12,4 +17,5 @@ Floris Bruynooghe <flub@devork.be>
Rafal Stozek
Donald Stufft <donald@stufft.io>
Nicolas Delaby <ticosax@free.fr>
Daniel Hahler <https://twitter.com/blueyed>
Hasan Ramezani <hasan.r67@gmail.com>
Michael Howitz
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ VENV:=build/venv

export DJANGO_SETTINGS_MODULE?=pytest_django_test.settings_sqlite_file

testenv: $(VENV)/bin/pytest

test: $(VENV)/bin/pytest
$(VENV)/bin/pip install -e .
$(VENV)/bin/py.test
$(VENV)/bin/pytest

$(VENV)/bin/python $(VENV)/bin/pip:
virtualenv $(VENV)
Expand All @@ -22,7 +19,7 @@ docs:

# See setup.cfg for configuration.
isort:
find pytest_django tests -name '*.py' -exec isort {} +
isort pytest_django pytest_django_test tests

clean:
rm -rf bin include/ lib/ man/ pytest_django.egg-info/ build/
22 changes: 14 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
:alt: Supported Python versions
:target: https://pypi.python.org/pypi/pytest-django

.. image:: https://travis-ci.org/pytest-dev/pytest-django.svg?branch=master
.. image:: https://github.com/pytest-dev/pytest-django/workflows/main/badge.svg
:alt: Build Status
:target: https://travis-ci.org/pytest-dev/pytest-django
:target: https://github.com/pytest-dev/pytest-django/actions

.. image:: https://img.shields.io/pypi/djversions/pytest-django.svg
:alt: Supported Django versions
:target: https://pypi.org/project/pytest-django/

.. image:: https://img.shields.io/codecov/c/github/pytest-dev/pytest-django.svg?style=flat
:alt: Coverage
Expand All @@ -28,10 +32,12 @@ pytest-django allows you to test your Django project/applications with the
<https://pytest-django.readthedocs.io/en/latest/contributing.html>`_
* Version compatibility:

* Django: 1.8-1.11, 2.0-2.2,
and latest master branch (compatible at the time of each release)
* Python: CPython 2.7, 3.4-3.7 or PyPy 2, 3
* pytest: >=3.6
* Django: 2.2, 3.2, 4.0 and latest main branch (compatible at the time of
each release)
* Python: CPython>=3.5 or PyPy 3
* pytest: >=5.4

For compatibility with older versions, use the pytest-django 3.*.* series.

* Licence: BSD
* Project maintainers: Andreas Pelme, Floris Bruynooghe and Daniel Hahler
Expand All @@ -53,11 +59,11 @@ Why would I use this instead of Django's `manage.py test` command?
Running your test suite with pytest-django allows you to tap into the features
that are already present in pytest. Here are some advantages:

* `Manage test dependencies with pytest fixtures. <https://pytest.org/en/latest/fixture.html>`_
* `Manage test dependencies with pytest fixtures. <https://pytest.org/en/latest/how-to/fixtures.html>`_
* Less boilerplate tests: no need to import unittest, create a subclass with methods. Write tests as regular functions.
* Database re-use: no need to re-create the test database for every test run.
* Run tests in multiple processes for increased speed (with the pytest-xdist plugin).
* Make use of other `pytest plugins <https://pytest.org/en/latest/plugins.html>`_.
* Make use of other `pytest plugins <https://pytest.org/en/latest/how-to/plugins.html>`_.
* Works with both worlds: Existing unittest-style TestCase's still work without any modifications.

See the `pytest documentation <https://pytest.org/en/latest/>`_ for more information on pytest itself.
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# reference: https://docs.codecov.io/docs/codecovyml-reference
coverage:
status:
project: true
patch: true
changes: true
project: false
comment: false
Loading

0 comments on commit 8e5d13e

Please sign in to comment.