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

tests: add test for magic-class #447

Merged
merged 6 commits into from
Aug 24, 2022

Conversation

tlambert03
Copy link
Member

in addition to testing napari ...

since magic-class is a main user of magicgui, this gives us additional warning if we're breaking something for downstream devs

@tlambert03
Copy link
Member Author

cc @hanjinliu ... I'd like to add this here, but it's hard to know what your test dependencies are (without trial & error and searching). If you'd like to add a testing extra, it would make it easier here to make sure I'm not breaking anything on your side without warning

@tlambert03 tlambert03 changed the title add test for magic-class tests: add test for magic-class Aug 24, 2022
@tlambert03 tlambert03 merged commit dd24971 into pyapp-kit:main Aug 24, 2022
@tlambert03 tlambert03 deleted the test-magicclass branch August 24, 2022 16:36
@hanjinliu
Copy link
Contributor

Hi, @tlambert03 ,
very sorry for the late reply. I was on a holiday trip...

It looks like you have found the dependencies, but I want to add that the dependencies of pyqtgraph and vispy are kind of extra ones. They are not necessary unless users want to import some of the widgets that are dependent of these modules. Widgets that dependent on these modules do not use the non-public API of magicgui.

In my tests their testing directories are in a different places. Maybe I should somehow fix the configuration in magic-class to avoid magicgui's test being too heavy. What do you think?

@tlambert03
Copy link
Member Author

I want to add that the dependencies of pyqtgraph and vispy are kind of extra ones. They are not necessary unless users want to import some of the widgets that are dependent of these modules

Yep, but they're necessary to run "pytest" (without ignoring specific tests), so they fall under your testing dependencies.

You could either setup a testing extra (see the setup.cfg here for an example), or use pytest.import orskip to make sure your tests run even if they aren't present.

It doesn't make magicgui tests any heavier, it's just one "additional " test, on top of the rest. Kinda like we test napari too. (Have a look at the workflow file here if you're curious how I'm testing).

In any case, it's fine either way :). I'll keep testing it as long as it continues to be useful :)

@hanjinliu
Copy link
Contributor

I see, thanks for the info!
I'll try to change the testing in a few days.

@tlambert03 tlambert03 added the tests related to testing label Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants