How to use py.test from Python?

前端 未结 7 910
旧巷少年郎
旧巷少年郎 2020-12-30 04:38

I\'m working in a project that recently switched to the py.test unittest framework. I was used to call my tests from Eclipse, so that I can use the debugger (e.g. placing br

7条回答
  •  一个人的身影
    2020-12-30 05:09

    For me it was this:

    pytest.main(["-x", "path to test file", "args"])
    

    For example:

    import pytest
    pytest.main(["-x", "/api/test", "-vv"])
    

提交回复
热议问题