After tests execution is finished using Django's manage.py test
command only number of passed tests is printed to the console.
(virtualenv) G:\Project\>python manage.py test Creating test database for alias 'default'... True .. ---------------------------------------------------------------------- Ran 2 tests in 0.017s OK Destroying test database for alias 'default'...
Is there any way to see:
I haven't found any solution in the doc.
Running python manage.py test is the right way to run all the tests in your projects at once, your error is caused by something else. I think your problem is caused because you may have a tests folder within your tests folder, which is confusing unittest.
Order in which tests are executedAll TestCase subclasses are run first. Then, all other Django-based tests (test cases based on SimpleTestCase , including TransactionTestCase ) are run with no particular ordering guaranteed nor enforced among them.
You need to open you init.py and import your tests. Show activity on this post. If you want to run a test case class which has the path <module_name>/tests/test_views.py , you can run the command python manage.py test <module_name>. tests.
You can pass -v 2
to the test
command:
python manage.py test -v 2
After running this command you'll get something like this (I'm using django 2, feel free to ignore migrations/database stuff):
Creating test database for alias 'default' ('file:memorydb_default?mode=memory&cache=shared')... Operations to perform: Synchronize unmigrated apps: messages, staticfiles Apply all migrations: admin, auth, contenttypes, sessions Synchronizing apps without migrations: Creating tables... Running deferred SQL... Running migrations: Applying contenttypes.0001_initial... OK ... Applying sessions.0001_initial... OK System check identified no issues (0 silenced). test_equal_hard (polls.tests.TestHard) ... ok <--------+ test_equal_simple (polls.tests.TestSimple) ... ok <--------+ | | That's your tests! >----------------------------+
By the way, v
stands for verbosity (You can also use --verbosity=2
):
python manage.py test --verbosity=2
Here's the excerpt from the python manage.py test --help
:
-v {0,1,2,3}, --verbosity {0,1,2,3}
Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With