Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#16925 closed Bug (fixed)

disconnect signal before checking test success

Reported by: adsworth Owned by: adsworth
Component: Python 3 Version: 1.3
Severity: Normal Keywords:
Cc: adsworth Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Disconnect the presave signal before calling assertEquals, in the test regressiontests.fixtures_regress.tests.TestFixtures.test_field_value_coerce
. If the test fails (as it currently does for Python 3) the pre_save signal stays connected and causes a multitude of later tests to error.

before fix:
Ran 4036 tests in 94.677s

FAILED (failures=505, errors=1375, skipped=56, expected failures=1, unexpected successes=1)

after fix:
Ran 4090 tests in 229.091s

FAILED (failures=600, errors=770, skipped=72, expected failures=2, unexpected successes=1)

Attachments (2)

fix-signal-disconnect.patch (729 bytes) - added by adsworth 4 years ago.
16925.patch (1.3 KB) - added by aaugustin 4 years ago.

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by adsworth

comment:1 Changed 4 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

The best best way to ensure the signal gets disconnected is to use a try / finally. See attached patch.

I'm not sure how to run the tests under Python 3 — I checked out the py3k branch, but fails with this error:

  File "", line 118
    print "Importing application %s" % module_name
SyntaxError: invalid syntax

If the new patch works for you, feel free to mark the ticket as RFC.

Changed 4 years ago by aaugustin

comment:2 Changed 4 years ago by adsworth

  • Triage Stage changed from Accepted to Ready for checkin

The patch from aaugustin works fine in Python3.

To run the test in Python 3 you need at least 3.2 and then run the py3ktest script in the py3k branch.

comment:3 Changed 4 years ago by Alex

  • Resolution set to fixed
  • Status changed from new to closed

In [16905]:

Fixed #16925 -- Make sure a signal is disconnected if the test fails. Thanks to aaugustin for the patch.

Note: See TracTickets for help on using tickets.
Back to Top