pytest-dev / pytest-dev/pytest-django

Option to keep db data after failed test in failfast mode ?

Open
#736 2 comments 0 reactions 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

When a test fails, it'd be very interesting to be able to explore the remaining test database, to better understand what happened.
Of course it would be only in a "failfast" case, eg. "-x" flag of pytest.

Is it already possible to obtain that ? If not, how could it be introduced ? By commiting instead of rollbacking the test transaction, I guess ?

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 reproducing the behavior with pytest's -x failfast option and inspect how pytest-django manages the test database and transaction cleanup. Done means a failed test in failfast mode leaves the remaining test database available for inspection without changing normal rollback behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend, databases, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.