-
Notifications
You must be signed in to change notification settings - Fork 131
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
mp plugin has issues with unittest.skip #465
Comments
Could you let me know which python version you're using, and which version of nose2? I wasn't able to reproduce using the latest release on my installed python versions. |
Hey! Sorry for taking a while to reply here, It turns out that simply loading the plugin isn't enough to cause the bug, you also need to actually activate the mp plugin. Setting always on in the config, or |
For UnitTest-wrapped functions, test_name() would convert a module.class.test_function into "module.test_function" and lose the class information. This is, unfortunately, not expected by the MultiProcess plugin, which has a different way of converting tests to their testids. This fix ensures for UnitTest-wrapped functions, test_name() returns a "module.class.function"-style name that complies with the manner that MultiProcess plugin expects. This PR fixes issue nose-devs#465.
Hi, While working on other issues (#468, #444) I came up with PR #472 and it appears to fix the decoration problem with unittest.skip just as it does with mock.patch. The proposed PR #466 somewhat misdiagnoses the bug: It is not about the function loader getting the name wrong, it is about the function loader acting on class methods in the first place! Class methods are the testcase loader's responsibility! |
Good to know! Thanks for working on addressing this issue. |
With #472 merged, I'm going to close this. In the upcoming release, this should be fixed. |
We don't run these tests on older macOS. Also update nose2 for https://ci.chromium.org/ui/p/infra/builders/try/luci-py-try-bionic-64/b8830888060843051873/overview nose-devs/nose2#465 Bug: 1099655 Change-Id: Ia892b6188205920e39f2e73bbccd301da58a8e8b Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/luci-py/+/3275033 Auto-Submit: Takuto Ikuta <[email protected]> Commit-Queue: Junji Watanabe <[email protected]> Reviewed-by: Junji Watanabe <[email protected]> NOKEYCHECK=True GitOrigin-RevId: 566de10961275887f6a16f9e3c3156c12d0acd7b
I seem to have come across a weird issue when using
unittest.skip
on individual methods in aunittest.TestCase
in combination with thenose2.plugins.mp
plugin. Here is an example to show my issue:Code (
test_ex.py
):Running without
mp
(correct behaviour):Running with
mp
:And one more example, if I comment out the
unittest.skip
decorator:When the mp plugin is enabled and the skip decorator is used, the test is incorrectly labelled. In addition to the misreporting, this also is an issue when naming specific tests to run:
It seems to have cut out the TestCase class name and is failing as a result, unsure if this is related to #42. Any help or suggestions would be greatly appreciated!
The text was updated successfully, but these errors were encountered: