unittest.py doesn't play well with trace.py - why?

前端 未结 3 2050
闹比i
闹比i 2021-01-04 11:45

Wow. I found out tonight that Python unit tests written using the unittest module don\'t play well with coverage analysis under the trace module.

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-04 12:18

    I don't know why trace doesn't work properly, but coverage.py does:

    $ coverage run foobar.py
    .
    ----------------------------------------------------------------------
    Ran 1 test in 0.001s
    
    OK
    $ coverage report
    Name     Stmts   Miss  Cover
    ----------------------------
    foobar       6      0   100%
    

提交回复
热议问题