From f6ae557522fa66199b1ac182d1cc71345ec4ce6c Mon Sep 17 00:00:00 2001 From: richarddushime Date: Thu, 19 Feb 2026 14:38:59 +0100 Subject: [PATCH] Remove deprecated program parameter --- fancylog/fancylog.py | 17 +---------------- tests/tests/test_deprecations.py | 17 ++--------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/fancylog/fancylog.py b/fancylog/fancylog.py index 0011878..bbb05a1 100644 --- a/fancylog/fancylog.py +++ b/fancylog/fancylog.py @@ -39,7 +39,6 @@ def start_logging( log_to_console=True, timestamp=True, logger_name=None, - program=None, ): """Prepare the log file, and then begin logging. @@ -84,8 +83,6 @@ def start_logging( logger_name If None, logger uses default logger; otherwise, logger name is set to `logger_name`. - program - Deprecated alias name for `package`. Returns ------- @@ -96,20 +93,8 @@ def start_logging( output_dir = str(output_dir) print_log_level = "DEBUG" if verbose else "INFO" - if program: - warnings.warn( - "`program` is deprecated since 0.6.0 and will be " - "removed in 0.7.0; use `package` instead.", - DeprecationWarning, - stacklevel=2, - ) - package = program - if not package: - raise ValueError( - "`package` or `program` (deprecated)` must be " - "passed to `start_logging()`." - ) + raise ValueError("`package` must be passed to `start_logging()`.") if log_to_file: if filename is None: diff --git a/tests/tests/test_deprecations.py b/tests/tests/test_deprecations.py index 83fff62..1b32464 100644 --- a/tests/tests/test_deprecations.py +++ b/tests/tests/test_deprecations.py @@ -5,22 +5,9 @@ def test_no_package_passed(tmp_path): """ - Test error is wrong if neither `package` or - `program` (deprecated) is raised. + Test error is raised if `package` is not passed. """ with pytest.raises(ValueError) as e: fancylog.start_logging(tmp_path) - assert "`package` or `program`" in str(e.value) - - -def test_program_warning_shown(tmp_path): - """ - Test depreciation warning is shown for `program`. - """ - with pytest.warns(DeprecationWarning) as w: - fancylog.start_logging(tmp_path, program=fancylog) - assert ( - "`program` is deprecated since 0.6.0 and will be removed in 0.7.0;" - in str(w[0].message) - ) + assert "`package` must be passed" in str(e.value)