1414
1515
1616@pytest .mark .parametrize ("cmd" , ("--version" , "-V" ))
17- def test_version (cmd : str ):
17+ def test_version (cmd : str , logot : Logot ):
1818 result = runner .invoke (main , cmd )
1919 assert result .exit_code == 0
2020 assert result .stdout .strip () == f"PyPMS v{ __version__ } "
21+ logot .assert_not_logged (logged .debug (f"PyPMS v{ __version__ } " ))
2122
2223
23- def test_info (capture ):
24+ def test_info (capture , logot : Logot ):
2425 result = runner .invoke (main , capture .options ("info" ))
2526 assert result .exit_code == 0
2627 assert dedent (result .stdout ).strip () == capture .output ("info" ).strip ()
28+ logot .assert_logged (logged .debug (f"PyPMS v{ __version__ } " ))
2729
2830
2931@pytest .mark .parametrize ("format" , (None , "csv" , "hexdump" ))
3032def test_serial (capture , format : str | None , logot : Logot ):
3133 cmd = "serial" if format is None else f"serial_{ format } "
32- result = runner .invoke (main , capture .options (cmd ))
34+ result = runner .invoke (main , capture .options (cmd , debug = True ))
3335 assert result .exit_code == 0
3436 assert result .stdout == capture .output (format )
3537
@@ -38,7 +40,7 @@ def test_serial(capture, format: str | None, logot: Logot):
3840
3941
4042def test_csv (capture , logot : Logot ):
41- result = runner .invoke (main , capture .options ("csv" ))
43+ result = runner .invoke (main , capture .options ("csv" , debug = True ))
4244 assert result .exit_code == 0
4345
4446 csv = Path (capture .options ("csv" )[- 1 ])
@@ -53,10 +55,12 @@ def test_csv(capture, logot: Logot):
5355def test_capture_decode (capture , logot : Logot ):
5456 result = runner .invoke (main , capture .options ("capture" ))
5557 assert result .exit_code == 0
56-
5758 csv = Path (capture .options ("capture" )[- 1 ])
5859 assert csv .exists ()
5960
61+ for msg in capture .debug_messages ("capture" ):
62+ logot .assert_logged (logged .debug (msg ))
63+
6064 result = runner .invoke (main , capture .options ("decode" ))
6165 assert result .exit_code == 0
6266 csv .unlink ()
0 commit comments