How to use py.test from Python?

前端 未结 7 883
旧巷少年郎
旧巷少年郎 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:18

    It seems that now (py.test version 2.0+) someone can also do this :

    import pytest
    
    pytest.main('-x {0}'.format(argument))
    
    # Or
    # pytest.main(['-x', 'argument'])
    

    Ref : https://pytest.org/latest/usage.html#calling-pytest-from-python-code

提交回复
热议问题