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

Implement support for using pytest #2735

Merged
merged 1 commit into from
Jun 17, 2016

Conversation

mvantellingen
Copy link
Member

This adds a conftest.py module to setup the test infrastructure
correctly. It doesn't yet add pytest and pytest-django to the testing
requirements so for now it is completly optional.

This change also updates the test_migrations testcase to use a regular
TestCase baseclass instead of the TransactionTestCase. Otherwise the
following tests fail with db errors.

This adds a conftest.py module to setup the test infrastructure
correctly. It doesn't yet add pytest and pytest-django to the testing
requirements so for now it is completly optional.

This change also updates the test_migrations testcase to use a regular
TestCase baseclass instead of the TransactionTestCase. Otherwise the
following tests fail with db errors.
@gasman gasman added this to the 1.6 milestone Jun 17, 2016
@mvantellingen
Copy link
Member Author

Pytest with py.test -n 8 (pip install pytest-xdist)

real    1m1.003s
user    7m33.844s
sys 0m8.229s

Current ./runtests:

real    1m49.558s
user    1m45.433s
sys 0m2.488s

@gasman
Copy link
Collaborator

gasman commented Jun 17, 2016

Unfortunately it appears that TransactionTestCase is required for TestForMigrations - otherwise it always succeeds and never reports on missing migrations. For example, edit one of the help_text attributes in testapp/templates/models.py - this should cause TestForMigrations to fail (as there is no corresponding migration), but this doesn't happen with a plain TestCase. Can't replicate this now - sorry for the noise!

@gasman gasman merged commit d82e38e into wagtail:master Jun 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants