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

Correct README.md examples and outputs using doctest #351

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

pjkundert
Copy link
Contributor

The 'README.md' contains numerous examples and expected outputs, but these don't appear to be regularly tested.

I added the formatting necessary to run "doctest" on the README.md and test the expected outputs. Mostly this was just adding a doctest-terminating blank line after the expected outputs. However, several of the tests showed some differences in output.

Check that these are indeed now correct, and then this should be ready to merge.

I also added instructions on how to run doctest on the README.md.

@astanin
Copy link
Owner

astanin commented Oct 8, 2024

Yeah, you're right. README was supposed to be used in tests, and it was, but probably between migrating from one CI system to another it was forgotten. It would be nice to add it to GitHub actions when all the tests pass.

@pjkundert
Copy link
Contributor Author

This includes a modification of _isnumber; it is logically equivalent, except that it has an explicit "fast path" for raw int and float values. It is (now) in the same logical form as _isint, and appears a bit more complex, but is otherwise logically unchanged.

I have added a section to the README discussing type deduction, and how to handle types that convert to int or float but where the str representation is desired by the user.

Also, @astanin, I noticed while testing this that, if wcwidth is made available, the pytest unit tests fail; this is unrelated to this change, and the master branch also exhibits this failure.

@astanin astanin merged commit 537d7b0 into astanin:master Oct 9, 2024
15 of 17 checks passed
@astanin
Copy link
Owner

astanin commented Oct 9, 2024

Thank you for the update and the fixes.

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