-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Report skipped ctypes tests as skipped #63692
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
Comments
Some skipped ctypes tests are reported as passed. Proposed patch adds explicit reporting them as skipped. See also bpo-18702. |
Grepping with the same regexes I used for bpo-19572 come up with some extra skips in the ctypes tests too; would you like me to create a new patch including them or would you like to do it, Serhiy? |
Please do this Zachary. |
Here's a patch. It turned out to be much more extensive than I expected, and the diff turned into a huge huge ugly monster that I hope Rietveld can help to make sense of, since the majority of the diff is simply changes in indentation level. The most major change of this patch is the addition of a "needs_symbol" decorator to ctypes.test.__init__, which is then used throughout the tests. Pre-patch, the tests are littered with constructs like this: """ These have all (I think) been simplified to: """ There are also several instances of tests guarded by "if sys.platform = 'win32':" or similar, which have been turned into @unittest.skipUnless, and several tests which were commented out which have been uncommented and given unconditional skips. On my Gentoo machine at home, the patch takes the ctypes test suite from 348 tests with 1 skip to 422 tests with 78 skips. |
Here's a new patch addressing your review comment, Serhiy. It also addresses some failures on Windows in test_values: Win_ValuesTestCase depends on 'pydll' being defined in the module toplevel and shadowing ctypes.pydll; this definition was removed some years ago (before ctypes was merged into Python). I replaced each instance of 'pydll' with 'pythonapi', which makes the tests pass (with appropriate update to test_frozentable's expectations), but I don't understand all of ctypes well enough to be sure that it is definitely the correct fix. Also, a few long lines that were already touched have been split (without messing with other long lines) and a couple of tests have been converted from "def X_test" to "def test_X" with an unconditional skip. Another empty file has also been removed: test_errcheck is completely commented out except for a couple of imports, so it is removed entirely. The test that calls doctest.testmod in test_objects has been adjusted to fail the test if any of the doctests fail, and to not care about sys.version. Finally, test_wintypes has been rearranged to skip the test class rather than the module on non-Windows platforms to keep the same number of tests between platforms. |
I can't say anything about pydll, other changes LGTM. Except that I'm not sure that test_wintypes needs a fix. |
I'd prefer to keep the change to test_wintypes, simply because I was rather surprised to find an extra test being run on Windows. As for the pydll/pythonapi issue, any thoughts from Amaury, Meador, or Alexander? The relevant change that removed the definition of pydll in test_values can be found here[1]. That also makes me wonder why exactly the test is named "*Win*_ValuesTestCase" and whether it actually needs a skip or just a rename, since there doesn't appear to me to be anything related to Windows about the test. |
New changeset 6f63fff5c120 by Zachary Ware in branch '3.4': New changeset 86d14cf2a6a8 by Zachary Ware in branch 'default': |
New changeset 08a2b36f6287 by Zachary Ware in branch '2.7': |
Committed; thanks for the review, Serhiy. |
New changeset 49a2bed5185a by Zachary Ware in branch '2.7': New changeset 374a9a259c09 by Zachary Ware in branch '3.4': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: