File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1111 InvalidDocTreeError ,
1212 build_sphinx_tree ,
1313 main ,
14+ panic ,
1415 publish ,
1516 toctree_indexer ,
1617 validate_documentation_tree ,
@@ -34,6 +35,24 @@ def static_path() -> Path:
3435 """Test static data folder."""
3536 return Path (__file__ ).parent / "static"
3637
38+ class TestLogging :
39+ """Test suite for logging features."""
40+
41+ def test_panic_sys_exit (self , mocker : MockerFixture ) -> None :
42+ """Tests that panic properly exits program with error exit code."""
43+ exit_patch = mocker .patch ("tovald.main.sys.exit" )
44+
45+ panic ("" )
46+ exit_patch .assert_called_once_with (1 )
47+
48+ def test_panic_print (self , mocker : MockerFixture ) -> None :
49+ """Tests that panic yields error message."""
50+ error_message = "test_panic_print"
51+ mocker .patch ("tovald.main.sys.exit" )
52+ print_patch = mocker .patch ("tovald.main.print" )
53+
54+ panic ("test_panic_print" )
55+ print_patch .assert_called_once_with (error_message )
3756
3857class TestValidateDocumentationTree :
3958 """Test suite for validate_documentation_tree function."""
You can’t perform that action at this time.
0 commit comments