From 7184b15f482ce911ef50051b7245434cbbdf865e Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 21 Dec 2024 12:31:35 +0100 Subject: [PATCH] Add decorated function to pytest runnables (#22325) Fixes: #22324 Closes #ISSUE Release Notes: - Fixed pytest decoracted function discovery --- crates/languages/src/python/runnables.scm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/languages/src/python/runnables.scm b/crates/languages/src/python/runnables.scm index 31994dfa2c..c61e9a23e5 100644 --- a/crates/languages/src/python/runnables.scm +++ b/crates/languages/src/python/runnables.scm @@ -41,6 +41,20 @@ (#set! tag python-pytest-method) ) +; decorated pytest functions +( + (module + (decorated_definition + (decorator)+ @decorator + definition: (function_definition + name: (identifier) @run @_pytest_decorated_method_name + (#match? @_pytest_decorated_method_name "^test_") + ) + ) @python-pytest-method + ) + (#set! tag python-pytest-method) +) + ; pytest classes ( (module