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

Test Suite is using GuiToolAssistant as a way to check if toolkit is Qt #553

Closed
kitchoi opened this issue Jun 26, 2020 · 1 comment
Closed
Labels
component: test suite Issues related to testing, test support, test interactions...

Comments

@kitchoi
Copy link
Contributor

kitchoi commented Jun 26, 2020

While I was working on #552, I realized skipping the Qt-specific test case using the skipIf(toolkit_object.toolkit != "qt4", ...) was not enough, I also had to add a skipIf(GuiTestAssistant.__name__ == "Unimplemented", ...).

This suggests that tests that require Qt, e.g. because the test body contain Qt specific code, are skipped relying on the fact that GuiTestAssistant is only implemented for Qt. This is not ideal, because as soon as GuiTestAssistant is implemented for other toolkit (e.g. wx, see #266), these tests will be run erroneously, causing build errors.

@kitchoi kitchoi added the component: test suite Issues related to testing, test support, test interactions... label Jun 26, 2020
@kitchoi
Copy link
Contributor Author

kitchoi commented Jun 26, 2020

That was my stupidity: In the case of when the GuiTestAssistant is not implemented, GuiTestAssistant.__init__ is overridden to raise NotImplemenetedError. The test case needs to place GuiTestAssistant after unittest.TestCase in the MRO so that the test loader can still instantiate the test case before it is skipped. Nothing is wrong here. Sorry for the noise.

@kitchoi kitchoi closed this as completed Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: test suite Issues related to testing, test support, test interactions...
Projects
None yet
Development

No branches or pull requests

1 participant