2017-06-22から1日間の記事一覧
例外が発生するケースのテストをしたい場合は以下のように with pytest.raises を使う。 def test_recursion_depth(): with pytest.raises(RuntimeError) as excinfo: def f(): f() f() assert "maximum recursion" in str(excinfo.value) as excinfoを使う…
例外が発生するケースのテストをしたい場合は以下のように with pytest.raises を使う。 def test_recursion_depth(): with pytest.raises(RuntimeError) as excinfo: def f(): f() f() assert "maximum recursion" in str(excinfo.value) as excinfoを使う…