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

WIP: By default run tests in tests folder #103

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

agoscinski
Copy link
Collaborator

Right now hatch test runs also files in top level directory, this is a bit annoying since one needs to specify hatch test -- tests. This is not really fixing it, I need to investigate this further.

Right now `hatch test` runs also files in top level directory, this is a
bit annoying since one needs to specify `hatch test -- tests`. This is
not really fixing it, I need to investigate this further.
@DropD
Copy link
Collaborator

DropD commented Jan 22, 2025

Right now hatch test runs also files in top level directory, this is a bit annoying since one needs to specify hatch test -- tests. This is not really fixing it, I need to investigate this further.

I never need to do that. Do you keep uncommitted test_xyz.py files in your top-level, which pytest recognizes as tests?

@agoscinski
Copy link
Collaborator Author

It runs for some reason a file called debug.py. There is also no test function in it. I dont fully understand this because I don't have this problem in other projects. This PR is more like a reminder to look at it. I dont think the change here really is a good solution.

@DropD
Copy link
Collaborator

DropD commented Jan 27, 2025

It runs for some reason a file called debug.py. There is also no test function in it. I dont fully understand this because I don't have this problem in other projects. This PR is more like a reminder to look at it. I dont think the change here really is a good solution.

It might be scanning the file for doctests. Since the file is not part of the repo I would recommend trying the following in a top-level conftest.py, which you can locally git-ignore: https://stackoverflow.com/questions/41358778/can-i-make-the-pytest-doctest-module-ignore-a-file

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

Successfully merging this pull request may close these issues.

2 participants