Skip to content

v2.0.0

Latest

Choose a tag to compare

@meshy meshy released this 15 Sep 12:03
· 28 commits to main since this release
f022bee

[2.0.0] - 2026-09-15

Changed

  • Exceptions raised through transaction_if_not_already when it was called from inside an existing transaction will no longer invalidate the outer transaction's context.
  • Remove attrs dependency.

Added

  • Added MariaDB and SQLite to the test matrix.
  • part_of_a_transaction now raises an error if it is called outside of tests. This prevents code which misleadingly runs after-commit callbacks. For the same reason, it will also fail when called within transaction test cases.
  • part_of_a_transaction now raises an error if unhandled callbacks are detected when it starts. This makes it more similar to transaction. The error can be silenced by setting the SUBATOMIC_CATCH_UNHANDLED_AFTER_COMMIT_CALLBACKS_IN_TESTS setting to False
  • run_after_commit now raises an error in tests if it doesn't know if callbacks should be run. This prevents tests from silently doing the wrong thing (i.e. not running the callbacks). To fix this error, use transaction instead of atomic (or to explicitly disable callbacks when testing low-level code use part_of_a_transaction). The error can be silenced by setting SUBATOMIC_AFTER_COMMIT_AMBIGUITY_ERROR_IN_TESTS setting to False.
  • Django 6.1 has been added to the test matrix.

Fixed

  • Disallowed nesting of part_of_a_transaction to prevent nonsense implication of nested partial transactions in tests. Fixes #150.
  • part_of_a_transaction now clears after-commit callbacks from the transaction before it exits. This avoids polluting the test's transaction with callbacks.