To show how pytest handles unittests, here’s a sample run of pytest on the simple unittests I wrote in the unittest introduction:

$ pytest test_um_unittest.py 
======================== test session starts =========================
collected 2 items                                                    

test_um_unittest.py ..                                         [100%]

========================= 2 passed in 0.04s ==========================

$ pytest -v test_um_unittest.py
======================== test session starts =========================
collected 2 items                                                    

test_um_unittest.py::TestUM::test_numbers_3_4 PASSED           [ 50%]
test_um_unittest.py::TestUM::test_strings_a_3 PASSED           [100%]

========================= 2 passed in 0.05s ==========================

As you can see, I didn’t provide any extra options, pytest finds unittests automatically.

Older post

pytest introduction