python: Fix decorated test detection (#22327)
Piotr Osiewicz
created
Follow-up to #22325, where I missed a couple points in the review that
were actually quite relevant.
Closes #ISSUE
Release Notes:
- N/A
Change summary
crates/languages/src/python/runnables.scm | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Detailed changes
@@ -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)
)
)