From b77b6da7062857360b3e288fa97911c26ca4afe6 Mon Sep 17 00:00:00 2001 From: vil02 <65706193+vil02@users.noreply.github.com> Date: Wed, 15 Apr 2026 19:05:00 +0200 Subject: [PATCH] Resolve dangerous-default-value / W0102 --- micropytest/core.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/micropytest/core.py b/micropytest/core.py index 13128a3..d7c7cc7 100644 --- a/micropytest/core.py +++ b/micropytest/core.py @@ -312,7 +312,7 @@ def run_tests( tests_path, show_estimates=False, context_class=TestContext, - context_kwargs={}, + context_kwargs=None, test_filter=None, tag_filter=None, exclude_tags=None, @@ -340,6 +340,8 @@ def run_tests( :param exclude_tags: (str or list) Optional tag(s) to exclude tests by :param show_progress: (bool) Whether to show a progress bar during test execution """ + if context_kwargs is None: + context_kwargs = {} discover_ctx = context_class(**context_kwargs) tests = discover_tests(discover_ctx, tests_path, test_filter, tag_filter, exclude_tags) test_results = run_discovered_tests( @@ -360,11 +362,14 @@ def run_discovered_tests( show_estimates=False, show_progress=True, context_class=TestContext, - context_kwargs={}, + context_kwargs=None, dry_run=False, ) -> list[TestResult]: """Run the given set of tests that were discovered in a previous step.""" + if context_kwargs is None: + context_kwargs = {} + # Logger root_logger = get_logger()