You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: remove pytest parametrize support, keep fixture features only
Remove all modules related to pytest.mark.parametrize and pytest cache:
- Delete call_spec.lua, nodeids.lua, marks.lua, strings.lua, tables.lua
- Delete jump/param.lua and its tests
- Remove Pytrize, PytrizeClear, PytrizeJump commands
- Remove .pytest_cache and pytest.ini from root markers
- Remove get_nodeids_path from paths.lua
- Update rename test to use .git instead of .pytest_cache as root marker
- Rewrite README to focus on fixture features only
Copy file name to clipboardExpand all lines: README.md
+14-80Lines changed: 14 additions & 80 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,89 +2,41 @@
2
2
3
3
## Short summary
4
4
5
-
Helps navigating `pytest.mark.parametrize` entries and fixtures by virtual text and jump to declaration commands, using `pytest`s cache and `treesitter`.
-`no_commands` can be set to `true` and the commands `Pytrize` etc won't be declared.
104
-
-`highlight` defines the highlighting used for the virtual text.
55
+
-`no_commands` can be set to `true` and the user commands won't be declared.
56
+
-`highlight` defines the highlighting used for virtual text.
105
57
-`metrics` when set to `true`, logs timing information via `vim.notify` after each jump-to-fixture and rename operation. Useful for understanding performance in large projects. The jump reports total time and index-build time; the rename reports total, grep, scoping (fixture resolution), and apply time.
106
58
-`preferred_input` which method to use for displaying results (if installed). Currently `'fzf-lua'` is supported — when set, fixture usages are displayed in an [`fzf-lua`](https://github.com/ibhagwan/fzf-lua) picker instead of the quickfix list. When `nil` (the default), results go to the quickfix list.
107
59
108
-
## Details
109
-
110
-
-`pytest`s cache is used to find the test-case ids (eg `test.py::test[None2-a1-b-c1-8]`) which means that the tests have to be run at least once.
111
-
Also old ids might confuse `pytrize`, but you can clear the cache with `pytest --cache-clear`.
112
-
-`treesitter` is used to find the correct entry in `pytest.mark.parametrize`.
113
-
114
60
## Jump to fixture
115
61
116
62
To jump to the declaration of a fixture under the cursor, do `PytrizeJumpFixture`:
To rename the fixture under the cursor, do `PytrizeRenameFixture`:
67
+
To rename the fixture under the cursor, do `PytrizeRenameFixture`.
122
68
123
69
## Fixture usages
124
70
@@ -127,18 +73,6 @@ To find all usages of the fixture under the cursor, do `PytrizeFixtureUsages`.
127
73
Results are loaded into Neovim's quickfix list and the quickfix window is opened automatically.
128
74
Each entry shows the file, line, and the line content where the fixture is used — as a parameter, a body reference, or inside `@pytest.mark.usefixtures(...)`. The fixture definition itself is excluded from the results.
129
75
130
-
## Input
131
-
132
-
In some cases the file-path is not printed by pytest, for example when a test fails when it might look something like:
If you trigger to jump to the declaration of the parameters in this case `pytrize` will find all files in the cache that matches this test-case id and if there is more than one ask you which one to jump to (via `vim.ui.select`).
141
-
142
76
### fzf-lua
143
77
144
78
When `preferred_input = 'fzf-lua'` is set and [`fzf-lua`](https://github.com/ibhagwan/fzf-lua) is installed, fixture usages (`PytrizeFixtureUsages`) are displayed in an fzf picker with a built-in previewer. Supported actions:
0 commit comments