3 ms·
What's an IDE and how does it refactor hundreds of semantically unrelated identifiers in one go?
by rustyminnow 2y ago
What's an IDE and how does it refactor hundreds of semantically unrelated identifiers in one go?
- cstrahan 2y agoI’m not a Python developer, but… I believe the idea is that those identifiers are semantically related: that fixture decorator inspects the formal parameter names so that it can pass the appropriate arguments to each test when the tests are run. A sufficiently smart IDE and/or language server would thus know that these identifiers are related, and performing a rename on one instance would thus rename all of the others. And maybe you were being facetious, but an IDE is an “Integrated Development Environment”. Edit: Yep. Took all of 60 seconds to find what I’m looking for, as I type this from my phone while sitting in my throne room: https://docs.pytest.org/en/6.2.x/fixture.html https://docs.pytest.org/en/6.2.x/fixture.html See the “Fixtures can request other fixtures” section, which describes the scenario from TFA. And this post describes the PyCharm support for refactoring fixtures: https://www.jetbrains.com/guide/pytest/tutorials/visual_pytest/fixtures/ https://www.jetbrains.com/guide/pytest/tutorials/visual_pyte...