pytest-dev / pytest-dev/pytest-django

Automatically run checks at the start of tests

Open
#337 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.5k
Forks
367
PR merge metrics
No merged PRs in 30d

Description

I've been trying to get Django's test runner to run manage.py check at the start of the test suite in django/django#6294. It actually used to do it in 1.7 and then no one noticed it disappearing in 1.8. There is already a solution in that PR but it requires a lot of secondary effort to fix all the check failures that appear in Django's own test suite.

The reason to run check is to avoid wasting time on tests when there is a setup related issue that shoudl be fixed first. Since tests don't run checks by default, TDD-only workflows (i.e. no runserver etc.) can miss check errors until e.g. CI runs them explicitly, which can waste effort. Also they take a trivial amount of time to run so don't slow tests down really.

I think it would probably be easier to add it to pytest-django before I finish my Django core PR. Also we're using pytest-django at work now, so it would fix it for me for the time being.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating pytest-django's test-runner integration and the entry point that invokes Django's test suite. Compare its behavior with manage.py check and review the existing solution in django/django#6294. Done means checks run at the start of the suite without requiring separate setup, with the relevant plugin tests passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend, testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.