[ENH] Implement junifer selftest to allow the users to test the library themselves #9
No reviewers
Labels
No labels
CRITICAL
Stale
WIP
bug
concept
coordinate
dataset
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
maintenance
maps
marker
mask
on hold
parcellation
preprocess
question
ready
storage
template-space
triage
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
juaml/junifer!9
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/selftest-cmd"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It might be the case that some users have specific working environments that are not comprised within the tests from junifer (i.e. specific versions of the dependencies). For solving issues in a more efficient way, it might be good if we can have a
junifer selftestcommand that run the test suite within the environment (so notox, justpytest).Do we want the user to see the
pytestoutputs in "real-time"?pytestinvocation is done viasubprocessas running it from the same process will use the cache after the first run.stdouttosys.stdoutand hence prints thepytestoutput in "real-time" but of course is dependent on system's buffer.junifer selftestcommand takes ~6-7 minutes to complete, so testing it by invoking in the test suite is a bit tricky now.Codecov Report
78.94% <66.66%> (-3.02%)Was it better to use
subprocessthan just pytest python api? https://docs.pytest.org/en/7.1.x/how-to/usage.html#calling-pytest-from-python-codeYeah it is related to the first point and since we intend to run it multiple times, we need separate process everytime. So, we create new process everytime, "why not just call the command?" was my thought.
What about using
--cache-clear?https://docs.pytest.org/en/6.2.x/cache.html
Do you mean to use this along with the subprocess implementation?
No. I meant to use the python interface with cache clear.
So I tested it and it works fine as well. Do we use this then?
Yes, sure.
I only see one problem with the
pytest.main()approach which I find after using it multiple times is that it does not handle keyboard interrupt gracefully.