Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add decorated function to pytest runnables (#22325)

Thomas7184b15f482c
diff --git a/crates/languages/src/python/runnables.scm b/crates/languages/src/python/runnables.scm
index 31994dfa2c2..c61e9a23e5d 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