Detect decorated pytest methods as runnable (#28652)
Closes #28096 Release Notes: - Fixed decorated pytest methods not being picked up as runnable
This commit is contained in:
parent
77544f42b1
commit
b25c3334cc
1 changed files with 20 additions and 0 deletions
|
@ -83,6 +83,26 @@
|
|||
)
|
||||
)
|
||||
|
||||
; decorated pytest class methods
|
||||
(
|
||||
(module
|
||||
(class_definition
|
||||
name: (identifier) @_pytest_class_name
|
||||
(#match? @_pytest_class_name "^Test")
|
||||
body: (block
|
||||
(decorated_definition
|
||||
(decorator)+ @_decorator
|
||||
definition: (function_definition
|
||||
name: (identifier) @run @_pytest_method_name
|
||||
(#match? @_pytest_method_name "^test_")
|
||||
)
|
||||
)
|
||||
) @_python-pytest-method
|
||||
(#set! tag python-pytest-method)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
; module main method
|
||||
(
|
||||
(module
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue