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

Enable CPython's test_int.py in CI #2367

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

austin-schick
Copy link
Contributor

This PR enables test_int.py as part of the Travis build, and fixes a variety of errors caught by the tests.

Most of the int tests were already passing! The changes in this PR are:

  • Throw errors on int(' '), int('+'), int('\t'), etc
  • Ignore string length limits when converting strings to ints if the conversion uses a power of 2 base
  • Allow int() to be called on array.array objects, and in general, any object that supports the buffer protocol
  • Skip a test that uses subinterpreters (by raising unittest.SkipTest from _testcapi.py, so no changes to the int tests were needed here)

@PierreQuentel
Copy link
Contributor

Hello Austin,

Travis CI builds have failed for a few weeks now, and there is no usable error message

We're sorry, but this data is not available. Please check the repository settings in Travis CI.

Do you have an idea where the problem could come from ?

@austin-schick
Copy link
Contributor Author

I saw your comment about fixing the doctests, and I see some recent green check marks, so maybe you were able to figure it out! Does the problem seem resolved? Brython was out of OSS build credits on Travis during January. I contacted Travis support in early February and got a new supply of credits. Maybe that was causing the errors you were seeing.

@austin-schick
Copy link
Contributor Author

I'm marking as a draft for the moment because it looks like a few files got out of whack after merging master

@austin-schick austin-schick marked this pull request as draft March 5, 2024 07:30
This prevents Qunit from throwing an error 'Uncaught Error: No tests were run.' before loading the Brython tests.
- Skip tests that use subinterpreters
- Fix errors in string to int conversions
- Allow int() to be called on any class that implements the buffer protocol, not just memoryview
- Use the existing invalid() function to generate new int error messages
@austin-schick austin-schick marked this pull request as ready for review June 9, 2024 05:54
@austin-schick
Copy link
Contributor Author

@PierreQuentel I think this PR is now ready for a review! The changes in www/tests/run_tests.html, www/src/Lib/_testcapi.py, and www/src/py_int.js are the important ones.

I'm not sure where the differences in www/src/version_info.js and www/src/stdlib_paths.js are coming from, but they seemed to persist even after I merged master into the PR.

@PierreQuentel
Copy link
Contributor

@austin-schick

Thanks for the update, but I have given up on Travis CI. In order to fix issue #2389 I had to add this line in run_tests.html

    <script id="webworker_82c5f471-0adf-47b1-8d1c-7bcc11aa54e6" class="webworker" type="text/python" src="z.py">
    </script>

Travis CI crashed because it doesn't seem to support <script> tags with a src with the extension .py

Coming after a long history of things I had to work on just to make it work, with little benefit in the end (I don't remember many bugs detected by the CI tool that had not been detected with the built-in test suite) I threw in the towel and disabled the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants