#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 |
Description
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)
Change History (5)
by , 13 years ago
Attachment: | fix-signal-disconnect.patch added |
---|
comment:1 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 13 years ago
Attachment: | 16925.patch added |
---|
comment:2 by , 13 years ago
Triage Stage: | Accepted → 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.
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 runtests.py fails with this error:
If the new patch works for you, feel free to mark the ticket as RFC.