launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #09483
[Merge] lp:~gz/launchpad/init_transactionfreeoperation_1020193 into lp:launchpad
Martin Packman has proposed merging lp:~gz/launchpad/init_transactionfreeoperation_1020193 into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #1020193 in Launchpad itself: "Failures in lp.scripts.tests.test_helpers on Python 2.7"
https://bugs.launchpad.net/launchpad/+bug/1020193
For more details, see:
https://code.launchpad.net/~gz/launchpad/init_transactionfreeoperation_1020193/+merge/113087
Fixes tests for TransactionFreeOperation context manager to use an instance, rather than trying to use the class directly. That happened to work in the past, but is bogus.
Launchpad knows this bit of trivia already:
<http://mail.python.org/pipermail/python-list/2011-September/612715.html>
--
https://code.launchpad.net/~gz/launchpad/init_transactionfreeoperation_1020193/+merge/113087
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~gz/launchpad/init_transactionfreeoperation_1020193 into lp:launchpad.
=== modified file 'lib/lp/scripts/tests/test_helpers.py'
--- lib/lp/scripts/tests/test_helpers.py 2011-12-19 23:38:16 +0000
+++ lib/lp/scripts/tests/test_helpers.py 2012-07-02 18:27:20 +0000
@@ -24,19 +24,19 @@
transaction.begin()
with ExpectedException(
AssertionError, 'Transaction open before operation'):
- with TransactionFreeOperation:
+ with TransactionFreeOperation():
pass
def test_transaction_during_operation(self):
"""When the operation creates a transaction, raise."""
with ExpectedException(
AssertionError, 'Operation opened transaction!'):
- with TransactionFreeOperation:
+ with TransactionFreeOperation():
transaction.begin()
def test_transaction_free(self):
"""When there are no transactions, do not raise."""
- with TransactionFreeOperation:
+ with TransactionFreeOperation():
pass
def test_require_no_TransactionFreeOperation(self):
@@ -49,5 +49,5 @@
def test_require_with_TransactionFreeOperation(self):
"""If TransactionFreeOperation is used, do not raise."""
with TransactionFreeOperation.require():
- with TransactionFreeOperation:
+ with TransactionFreeOperation():
pass
Follow ups