From dfbdba924fd7cf12ce92f7a86b97590d25b75733 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 9 Mar 2017 09:55:55 -0500 Subject: [PATCH] Reverted "Refs #16682 -- Tested transaction.atomic() with KeyboardInterrupt." This reverts commit d895fc9ac01db3d3420aa7c943949fe17b3ce028 since the test is problematic as described in the ticket. --- tests/transactions/tests.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/transactions/tests.py b/tests/transactions/tests.py index 8290bce1e5..398a14be4e 100644 --- a/tests/transactions/tests.py +++ b/tests/transactions/tests.py @@ -1,5 +1,3 @@ -import os -import signal import sys import threading import time @@ -218,18 +216,6 @@ class AtomicTests(TransactionTestCase): transaction.savepoint_rollback(sid) self.assertQuerysetEqual(Reporter.objects.all(), ['']) - @skipIf(sys.platform.startswith('win'), "Windows doesn't have signals.") - def test_rollback_on_keyboardinterrupt(self): - try: - with transaction.atomic(): - Reporter.objects.create(first_name='Tintin') - # Send SIGINT (simulate Ctrl-C). One call isn't enough. - os.kill(os.getpid(), signal.SIGINT) - os.kill(os.getpid(), signal.SIGINT) - except KeyboardInterrupt: - pass - self.assertEqual(Reporter.objects.all().count(), 0) - class AtomicInsideTransactionTests(AtomicTests): """All basic tests for atomic should also pass within an existing transaction."""