Add decorated function to pytest runnables (#22325)

Thomas created

Fixes: #22324

Closes #ISSUE

Release Notes:

- Fixed pytest decoracted function discovery

Change summary

crates/languages/src/python/runnables.scm | 14 ++++++++++++++
1 file changed, 14 insertions(+)

Detailed changes

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