@@ -503,3 +503,36 @@ def test_accept_empty(
503
503
assert run_result .exit_code == 0
504
504
else :
505
505
assert run_result .exit_code == 1
506
+
507
+
508
+ ##################################################
509
+ # Deprecation Tests
510
+ ##################################################
511
+ @pytest .mark .parametrize (["paths" ], [pytest .param ([SAMPLES_DIR ])])
512
+ @pytest .mark .parametrize (
513
+ ["deprecated_option" ],
514
+ [
515
+ pytest .param (["--failunder=60" ]),
516
+ pytest .param (["--followlinks" ]),
517
+ pytest .param (["--skipclassdef" ]),
518
+ pytest .param (["--skipfiledoc" ]),
519
+ pytest .param (["--skipinit" ]),
520
+ pytest .param (["--skipmagic" ]),
521
+ ],
522
+ )
523
+ def test_deprecations (paths , deprecated_option , runner : CliRunner ):
524
+ """Test that using deprecated CLI options logs a warning
525
+
526
+ Parameters
527
+ ----------
528
+ paths: List[str]
529
+ Path arguments provided to CLI. These should be made absolute before they are passed to
530
+ :func:`docstr_coverage.cli.collect_filepaths`
531
+ deprecated_option: List[str]
532
+ CLI option that has been deprecated
533
+ runner: CliRunner
534
+ Click utility to invoke command line scripts"""
535
+ run_result = runner .invoke (execute , deprecated_option + paths )
536
+ assert run_result .stdout .startswith (
537
+ "Using deprecated {}" .format (deprecated_option [0 ].split ("=" )[0 ])
538
+ )
0 commit comments