Opened 10 years ago

Closed 8 years ago

#21549 closed Cleanup/optimization (fixed)

Fixture loading warning when the file is not found should be an exception

Reported by: Michał Pasternak Owned by: Andrew Kuchev
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Fixture lodaing should fail with an exception when there is no fixture file in both loaddata AND unit tests.

Any reasons, why do we silently ignore the fact of missing fixture file ATM?

If none, I can try working on a patch.

Change History (7)

comment:1 by Florian Apolloner, 10 years ago

Component: UncategorizedCore (Management commands)
Triage Stage: UnreviewedAccepted
Version: 1.6master

The current behavior of issuing a warning is indeed kind of odd.

comment:2 by bugZPDX, 10 years ago

Owner: changed from nobody to bugZPDX
Status: newassigned

The loaddata function in find_fixtures via load_label warns properly, however something in the interactive command is masking the error. I will continue investigating the issue.

comment:3 by Tim Graham, 8 years ago

Easy pickings: set
Owner: bugZPDX removed
Status: assignednew
Summary: Fixture loading should fail with a BIG LOUD EXCEPTION when the file is not foundFixture loading warning when the file is not found should be an exception
Type: BugCleanup/optimization

The idea is to change the warning to CommandError. The warning about "No fixture data found" in that same file might be able to be changed as well. Some tests will need to be adapted and we'll need a mention in the release notes.

comment:4 by Andrew Kuchev, 8 years ago

Owner: set to Andrew Kuchev
Status: newassigned

in reply to:  3 comment:5 by Andrew Kuchev, 8 years ago

Replying to timgraham:

The warning about "No fixture data found" in that same file might be able to be changed as well. Some tests will need to be adapted and we'll need a mention in the release notes.

"No fixture data found" was an error before 2013, however it has been changed to a warning with PR #799. Should it be implemented as error again?

comment:6 by Tim Graham, 8 years ago

Thanks for that research. We can keep it as is.

comment:7 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In d5b90c8e:

Fixed #21549 -- Made loaddata's 'fixture not found' warning an exception.

Thanks to mpasternak for the report and Tim Graham for the review.

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