-
Notifications
You must be signed in to change notification settings - Fork 2
FAQ
Q: I'm getting a DatabaseError
when running the tests bu I didn't do anything to break the schema. How do I solve this?
A: Use the --create-db
option with the py.test
command. pytest-django
creates the test database using the syncdb
command built in django, it does not care about migrations because all we need for testing is a stable schema, not any data you might introduce/modify with migrations.
Q: I see a lot of tests are being skipped. Why is that?
A: First let's check what tests are being skipped. It's very likely you might find two types of tests being skipped. The first case are tests marked as slow.
SKIP [3] /Users/you/.virtualenv/myvenv/lib/python2.7/site-packages/pytest_config/plugin.py:192: Needs --runslow option to run
These are skipped by default so you are able to run the test suite as much as you need without loosing too much time in it. To have them run just use the --runslow
.
The second type are previously passed PEP8 tests. You don't need to run this every time by yourself; whenever a PEP8 error occurs in your file, pytest will let you know raising an error and marking such test with an E
. But if you want to see them run, just use the '--clearcache' option.
SKIP [47] /Users/you/.virtualenv/myvenv/lib/python2.7/site-packages/pytest_pep8.py:64: file(s) previously passed PEP8 checks