#25176: TestCase: an error in setUpTestData snowballs across the entire test
suite
--------------------------------------+------------------------------------
Reporter: adamchainz | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by adamchainz):
The test method would never be reached - we're triggering an error in
`setUpClass` which means the tests don't get run.
The above test patch catches the breakage and allows the tests to continue
- in the "broken" world. I'm not sure this is legit or even if it works
now it might not be forwards compatible with future edits .
I also experimented with a broken test case with `@expectedFailure`
wrapped around it but that's not sensitive enough since it allows any
exception to be expected. It might be possible to write a custom
`expectedFailure` decorator that checks it was the custom exception raised
during the test case and marks it as a pass/skip/expected failure, but
when I briefly looked it seemed a bit hacky.
--
Ticket URL: <https://code.djangoproject.com/ticket/25176#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.5ba2e9fe7404764a2967b90a8a75a09c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.