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

Don't reinitialize a TEST_MIRROR (duplicate work) on REUSE_DB=1. #237

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions django_nose/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,13 @@ def setup_databases(self):
# MySQLdb doesn't allow it, and SQLAlchemy attempts to reuse
# the existing connection from its pool.
connection.close()
elif (connection.settings_dict.get('TEST', {}).get('MIRROR') or
connection.settings_dict.get('TEST_MIRROR')):
# The db.TEST.MIRROR setting (or db.TEST_MIRROR in Django 1.6
# and below) specifies that this is a mirror of another
# database. We don't need to initialize the same database
# twice, so skip this round.
pass
else:
# Reset auto-increment sequences. Apparently, SUMO's tests are
# horrid and coupled to certain numbers.
Expand Down