Oha Noch
Oha Noch

Reputation: 404

pytest verbose output explanation

I am using pytest-django to run unit tests I made. When I use the -v flag I get an output like:

dashboard/apps/excel_import/tests.py::ExcelImportTestCase::test_multiple_excel PASSED [ 50%]
dashboard/apps/excel_import/tests.py::ExcelImportTestCase::test_specific_excel PASSED [100%]

I can't find in the pytest docs, or anywhere else on google, what the PASSED [ 50%] means. I have 4 asserts in that specific test, does it mean I passed 2 and failed 2? if so then why doesn't it tell me I failed some tests?

I don't know if this is relevant but I am also using python-cov for code coverage. The code coverage results claim 100% of that file is being run, so it doesn't seem like only half the tests were run or something of the sort.

If anyone know what the PASSED [ 50%] means I will be very grateful for the insight. Thanks in advance for any help available!

Upvotes: 1

Views: 4326

Answers (1)

jwodder
jwodder

Reputation: 57510

"PASSED" means the listed test passed. [ 50%] is how many of the tests have been run so far.

Upvotes: 3

Related Questions