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

Document how to invoke pytest #1

Open
EwoutH opened this issue Sep 1, 2022 · 3 comments
Open

Document how to invoke pytest #1

EwoutH opened this issue Sep 1, 2022 · 3 comments

Comments

@EwoutH
Copy link

EwoutH commented Sep 1, 2022

This repository has a unusual structure with the extra layer directories of pydsol/core for both the src and tests folder. This makes running pytest non-trivial.

The docs state that can be pytest used:

For the unit tests, pytest is used, potentially with pytest-cov to assess

But with all "standard" invokements of Pytest I get either an import error or a warning that no tests are found.

 ModuleNotFoundError: No module named 'pydsol'

With this directory structure, which command needs to be ran from which folder for pytest to work?

@averbraeck
Copy link
Owner

Good point. I copied the structure from several other Python projects, but it can probably be streamlined better I will see how I can improve it! Tips are always welcome.

Second point: The readthedocs pages still lack a good description how to install the project locally on your computer such that the module tests, coverage, demos, and code run best.

@EwoutH
Copy link
Author

EwoutH commented Sep 19, 2022

I think the big question is if this repository will include other components than the core.

If not, an easy fix would be to flatten the directory to src/pydsol_core and test/pydsol_core.

Best practice is to even don't include a src folder for the functional code. That would result in having pydsol_core and test/pydsol_core.

Your library does not belong in an ambiguous src or python subdirectory.

You could even consider dropping de _core suffix completely, and just call it pydsol. pydsol is still available on PyPI btw.

I could create a PR with these changes, if you want.

@EwoutH
Copy link
Author

EwoutH commented Sep 19, 2022

I created a PR with a possible refactor and CI implementation which follows best practices and works easily with CI: #2

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