How to make pytest run doctests as well as normal tests directory?

前端 未结 4 1281
南方客
南方客 2021-01-01 14:54

We currently have pytest with the coverage plugin running over our tests in a tests directory.

What\'s the simplest way to also run doctest

4条回答
  •  悲哀的现实
    2021-01-01 15:25

    worked with doctest as well as with plain tests in one module. for a non-doctest test to be picked up, standard py.test discovery mechanism applies: a module name with test prefix, test function with test prefix.

提交回复
热议问题