amusecode / amuse

Astrophysical Multipurpose Software Environment. This is the main repository for AMUSE
http://www.amusecode.org
Apache License 2.0
152 stars 98 forks source link

Move code tests to code dirs (attempt 2) #1022

Open rieder opened 7 months ago

rieder commented 7 months ago

The idea is that the tests for a specific community code (which is available as a separate package) should be included with that code, and not in a centralised place.

rieder commented 7 months ago

If this PR is merged, the tests for a code will be available under src/amuse/community/{codename}/test_{code}.py. Maybe it should be even simpler, src/amuse/community/{codename}/test.py?

LourensVeen commented 7 months ago

Assuming the tests will all be in Python, then making a src/amuse/community/{codename}/tests/ directory with one or more test_<something.py files would be the standard way to do it. Pytest will auto-discover this, and we could set it up so that you can run pytest from the root to run all tests, or from a community code subdirectory to only run its tests.

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.

LourensVeen commented 5 months ago

Hmm, I think this is a good idea, and it's tempting to do it while working on the new build system. I will want to test things anyway to reduce the chances of breaking anything, and since I'm setting up a new system to build and install, I might as well add running tests to it. If it's just moving the files...

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.