Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require transaction 3.0 and drop dm.transaction.aborthook.
Make calling add_abort_hooks (kept for BWC) emit a warning. Fixes #17
- Loading branch information
Showing
6 changed files
with
49 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tests for the (deprecated) transactions.py. | ||
""" | ||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
|
||
import unittest | ||
import warnings | ||
|
||
# pylint:disable=bad-option-value,import-outside-toplevel | ||
|
||
class TestWarnings(unittest.TestCase): | ||
|
||
def test_add_abort_hook(self): | ||
with warnings.catch_warnings(record=True) as w: | ||
warnings.simplefilter('always') | ||
|
||
import nti.transactions.transactions as T | ||
T.add_abort_hooks() | ||
|
||
self.assertEqual(len(w), 2, w) | ||
self.assertIn('is deprecated', str(w[0])) | ||
self.assertIn('test_transactions', str(w[0])) | ||
self.assertIn('add_abort_hooks', str(w[1])) | ||
self.assertIn('test_transactions', str(w[1])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters