-
Notifications
You must be signed in to change notification settings - Fork 790
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
uv run pytest not recognizing the project module #9291
Comments
You'll probably need to define a build system so your project is installed in the environment and discoverable by pytest. |
Thank you for the response. The link was helpful. In the meantime, the following gets
Interestingly, |
It's possible that https://docs.pytest.org/en/stable/explanation/goodpractices.html could help here, they have a section for your case: Tests as part of application code |
I did some more reading here, and your case should work with:
or
as described in the pytest documentation. |
@zanieb Thank you!! What you provided is definitely worth including in the documentation that describes setting up an application with Even better, it may be worthwhile to include a init command that includes the file structure for testing |
The problem is that, in Rust, there's a standardized test runner. In Python, there is not. We'd get complaints if we configured the project with pytest by default, though maybe we should anyway. |
@zanieb My take on this is that anyone with a POV has what they need (expertise) to make the change to how they like it. The goal of |
had same issue where fixed by adding this to [build-system]
requires = ['setuptools']
build-backend = 'setuptools.build_meta' |
My project structure is:
The
test_parser.py
references the module:I can build and run the parser but I cannot seem to get
uv run pytest
to run without getting a module not found error.Apologies for the hyper newby question here.
The text was updated successfully, but these errors were encountered: