Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_django_clear_outbox should clear mail.outbox instead of creating new list #407

Merged

Conversation

peterlauri
Copy link
Contributor

The _django_clear_outbox fixture creates a new list, not clearing the existing mailbox. This can cause problems as fixture execution order cannot be guaranteed, and there might be fixtures (in my case an mailoutbox fixture) that just contains a reference to mail.outbox to be able to check what emails was sent out by the system... however, tests fails randomly as sometimes my own fixture actually gets reference to an old mailbox, not the newly created one...

…e misbehavior of there are others referencing mail.outbox... suddely they don't get mails to their mailbox...
@peterlauri peterlauri force-pushed the clear_mailbox_should_not_create_new_list branch from 2d4959d to a72922d Compare October 27, 2016 12:01
@pelme pelme merged commit 2aadcb1 into pytest-dev:master Nov 6, 2016
@pelme
Copy link
Member

pelme commented Nov 6, 2016

Thanks! :)

@peterlauri peterlauri deleted the clear_mailbox_should_not_create_new_list branch November 21, 2016 08:32
mfa pushed a commit to aexeagmbh/pytest-django that referenced this pull request May 17, 2017
timb07 pushed a commit to timb07/pytest-django that referenced this pull request May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants