Pytest Testing Idioms

From NovaOrdis Knowledge Base
Revision as of 03:28, 16 February 2022 by Ovidiu (talk | contribs) (→‎Overview)
Jump to navigation Jump to search

Internal

Overview

Tested Code is Supposed to Throw Exception

import pytest

def test_something_that_should_throw_exception():
    with pytest.raises(Exception) as e_info:
        my_method()