Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanding Pytest configuration lookup #142

Closed
julianolf opened this issue Jun 3, 2024 · 2 comments
Closed

Expanding Pytest configuration lookup #142

julianolf opened this issue Jun 3, 2024 · 2 comments

Comments

@julianolf
Copy link

First of all, I just wanted to say thanks for the awesome plugin! It just makes configuring a debugger for Python on nvim as easy as it can be.

Going on the topic, I recently started working on a project that moved all tooling configurations to the pyproject.toml file, including Pytest's. Because of this, debugging tests required manually setting up the test runner.

I tried to create an empty pytest.ini file as a workaround, but then Pytest stopped reading the pyproject.toml file. According to the documentation, pytest.ini and .pytest.ini files take precedence over other configuration files. https://docs.pytest.org/en/8.2.x/reference/customize.html#configuration-file-formats

I like the way I used to move between projects with different test runners without having to do anything special or complicated—just open files, hit a few keys, and start debugging.

To regain that convenience, I wrote a function that searches for Pytest configurations in various files (pytest.ini, .pytest.ini, pyproject.toml, tox.ini, and setup.cfg), as described in the documentation.

I was wondering if adding this complexity to look for Pytest configurations in different files is something you would be willing to incorporate into the plugin?

@mfussenegger
Copy link
Owner

I was wondering if adding this complexity to look for Pytest configurations in different files is something you would be willing to incorporate into the plugin?

I don't want to go too overboard with the detection, but I added pyproject.toml with #144 seeing how pyproject.toml has full core backing with PEPs and all.

@julianolf
Copy link
Author

It works perfect for me. Thanks for the addition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants