From fac5118f104fe907926428ee664bfc82bc92d171 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Sat, 21 Dec 2024 14:11:52 +0100 Subject: [PATCH] python: Fix decorated test detection (#22327) Follow-up to #22325, where I missed a couple points in the review that were actually quite relevant. Closes #ISSUE Release Notes: - N/A --- crates/languages/src/python/runnables.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/languages/src/python/runnables.scm b/crates/languages/src/python/runnables.scm index c61e9a23e5de59d2583313bfec93d3a65560ae78..8cdb0d77eb249bb655d4421ce742c4d4afe5ad72 100644 --- a/crates/languages/src/python/runnables.scm +++ b/crates/languages/src/python/runnables.scm @@ -36,7 +36,7 @@ (function_definition name: (identifier) @run @_pytest_method_name (#match? @_pytest_method_name "^test_") - ) @python-pytest-method + ) @_python-pytest-method ) (#set! tag python-pytest-method) ) @@ -45,12 +45,12 @@ ( (module (decorated_definition - (decorator)+ @decorator + (decorator)+ @_decorator definition: (function_definition - name: (identifier) @run @_pytest_decorated_method_name - (#match? @_pytest_decorated_method_name "^test_") + name: (identifier) @run @_pytest_method_name + (#match? @_pytest_method_name "^test_") ) - ) @python-pytest-method + ) @_python-pytest-method ) (#set! tag python-pytest-method) ) @@ -76,7 +76,7 @@ (function_definition name: (identifier) @run @_pytest_method_name (#match? @_pytest_method_name "^test") - ) @python-pytest-method + ) @_python-pytest-method (#set! tag python-pytest-method) ) )