Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

weird.py 675B

1 year ago
1234567891011121314151617181920212223
  1. import unittest
  2. from twisted.internet import defer
  3. # Used in test_tests.UnhandledDeferredTests
  4. class TestBleeding(unittest.TestCase):
  5. """This test creates an unhandled Deferred and leaves it in a cycle.
  6. The Deferred is left in a cycle so that the garbage collector won't pick it
  7. up immediately. We were having some problems where unhandled Deferreds in
  8. one test were failing random other tests. (See #1507, #1213)
  9. """
  10. def test_unhandledDeferred(self):
  11. try:
  12. 1 / 0
  13. except ZeroDivisionError:
  14. f = defer.fail()
  15. # these two lines create the cycle. don't remove them
  16. l = [f]
  17. l.append(l)