Reintroduce skimage.test utility#5909
Conversation
Prior to the conversion to pytest users could import skimage and then run the tests via skimage.test(). This PR restores that behavior, copying an existing approach based on a PytestTester class from NumPy. Tests for a single submodule can be run using: skimage.test(['skimage.color'])
This test case does not seem to have been updated when we updated the camera image
|
Hello @grlee77! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2021-10-19 01:45:26 UTC |
stefanv
left a comment
There was a problem hiding this comment.
Thanks, Greg, this is perfect.
Without this change, 'python setup.py sdist' fails with a circular import unless _remap.pyx has already been compiled
|
Nice, that last commit will be helpful for the lazy loading PR as well! |
|
Now it is failing because we don't require pytest in our runtime requirements, but We could move |
|
Can we just do |
…ytest add git date and hash to __version__ in dev builds
The issue was the following lines predating this PR: scikit-image/skimage/_shared/testing.py Lines 24 to 34 in d44ceda We only ever import from |
|
MacOS failures look unrelated: update: I suspect that this is related given that other recent PRs passed. I suspect the change to |
|
Looks good to me; @hmaarrfk ? |
| [tag for tag in __version__.split('+') | ||
| if not tag.startswith('git')] | ||
| ) | ||
| __version__ += f'+git{git_date}.{git_hash}' |
There was a problem hiding this comment.
Do we not want to use this as our new version? This is strange reporting different versions for different ways of testing the code.
There was a problem hiding this comment.
Yes, that's probably a good idea.
There was a problem hiding this comment.
na, this is ok. this checks for dev in the version. I think it is fine.
|
Thanks! |
Description
resolves #3569 by reintroducing
skimage.test. Users can run tests viaor for a specific modules with more verbose output:
I had one test failure locally in a viewer plugin test that involved the
cameraimage. The issue seems to be that these tests are getting skipped on CI so we never updated the expected value when we updated the camera image.As suggested by @hmaarrfk in #3569, GHA should run the tests via
skimage.test()for thesdisttest case.Checklist
./doc/examples(new features only)./benchmarks, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py.doc/release/release_dev.rst.