2 ms·
Write instructions on how to do this in any IDE.
by 1-more 2y ago
Write instructions on how to do this in any IDE.
- morningsam 2y agoIn PyCharm: Move cursor on any occurence or definition of "database" fixture, press the "Rename" hotkey (Shift+F6), delete old name and type new name, press Enter key to confirm.
- 1-more 2y agoWouldn’t that be limited to the single function?
- morningsam 2y agoA single fixture, yes. If there are many fixtures of the same name in different test modules, it wouldn't work, but that's not how I understood the problem in the blog post, which says >rename every instance of a pytest fixture from database -> db Every instance of a fixture, not every instance of all fixtures of the same name.
- cstrahan 2y agoThe fine folks at JetBrains already have done just that: https://www.jetbrains.com/guide/pytest/tutorials/visual_pytest/fixtures/ https://www.jetbrains.com/guide/pytest/tutorials/visual_pyte...
- 1-more 2y agoI don’t think that this will handle what the author wants, though. If each function takes db as an argument and uses it internally, those don’t count as references that you can change globally, right?