-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support range-less "child" tests (#172)
Not all tests have a unique range which applies to them. For example, in pytest, a test function can be parametrized to produce multiple different test instances for the same range. neotest currently assumes that any cursor position in a file maps to a single test, and selects the deepest-nested such test: this results in the last test instance for a test function being focused, instead of the whole test: the only way to run other (or all) instances is via the summary view. This commit changes neotest's behaviour, by introducing support for "child" test positions: these are simply test positions with `range` set to `nil`. This commit updates all[0] direct accesses of `range` on positions with calls to `Tree:closest_value_for("range")`: this will traverse up the parents of a node, returning the first non-`nil` `range` value. Child tests can be run via the summary view (directly, or via marks), but any operations based on cursor position in a buffer will operate on the parent test. Fixes: #147 [0] With the exception of `positions.contains()`, which doesn't handle _test_ positions.
- Loading branch information
Showing
9 changed files
with
75 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters