Coverage for tests/test_cli.py: 100.00%

11 statements  

« prev     ^ index     » next       coverage.py v6.4.1, created at 2022-09-04 11:35 +0200

1"""Tests for the `cli` module.""" 

2 

3import pytest 

4 

5from dependenpy import cli 

6 

7 

8def test_main(): 

9 """Basic CLI test.""" 

10 with pytest.raises(SystemExit) as exit: # noqa: PT012 

11 cli.main([]) 

12 assert exit.code == 2 

13 

14 

15def test_show_help(capsys): 

16 """ 

17 Show help. 

18 

19 Arguments: 

20 capsys: Pytest fixture to capture output. 

21 """ 

22 with pytest.raises(SystemExit): 

23 cli.main(["-h"]) 

24 captured = capsys.readouterr() 

25 assert "dependenpy" in captured.out