Skip to content

TST: Add tests for the conversion utilities#16007

Merged
mattip merged 1 commit intonumpy:masterfrom
eric-wieser:add-converter-tests
Apr 22, 2020
Merged

TST: Add tests for the conversion utilities#16007
mattip merged 1 commit intonumpy:masterfrom
eric-wieser:add-converter-tests

Conversation

@eric-wieser
Copy link
Copy Markdown
Member

This way we can test them without having to try and guess their behavior from the functions that use them.

This also makes a bit more apparently the inconsistencies between them.


Written because I found some bugs in the converters, and had nowhere good to put the tests.

This way we can test them without having to try and guess their behavior from the functions that use them.

This also makes a bit more apparently the inconsistencies between them.
class StringConverterTestCase:
allow_bytes = True
case_insensitive = True
exact_match = False
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bit weird, why do we support partial matches, seems like it can cause confusion with user code when C can be used for order as well as mode.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's weird, but my goal of this PR was to test the behavior that's already present. I wouldnt be opposed to someone else championing for deprecations once this is in.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, Every time I saw it, I thought it should be deprecated, but it also never felt super pressing. Which doesn't mean it shouldn't be done, just that I didn't particularly feel like actually doing it when stumbling over it :).

@mattip mattip merged commit b5ba51c into numpy:master Apr 22, 2020
@mattip
Copy link
Copy Markdown
Member

mattip commented Apr 22, 2020

Thanks @eric-wieser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants