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

Improved the check_type and check_valid_size validation functions #2084

Merged
merged 3 commits into from Sep 9, 2019

Conversation

tomgrainge
Copy link

@tomgrainge tomgrainge commented Sep 6, 2019

A couple of minor improvements have been made:

  • The check_type function now tests for lists of length 1 so the
    returned mesaging is better.
  • check_valid_size() now passes the name variable into check_type
    as this is a required argument.

This fixes #2083.

@tomgrainge tomgrainge force-pushed the validation branch 3 times, most recently from fccad72 to c1873ae Compare September 9, 2019 09:04
@tomgrainge
Copy link
Author

I am not quite sure why the coverage tests are still failing. I have tried to run the coverage tests on my local machine by they do not show up any issues unfortunately.

@rsokl
Copy link
Contributor

rsokl commented Sep 9, 2019

I believe that you need a test in which typ is a length-1 tuple. Currently, none of your tests trigger that branch of the if-statement.

@Zac-HD
Copy link
Member

Zac-HD commented Sep 9, 2019

@rsokl - nope, it's actually a custom checker we have for validation helpers, not the coverage library. It'll be easier for me to push a fix than explain I think!

tg and others added 3 commits September 10, 2019 08:00
A couple of minor improvements have been made:
- The check_type function now tests for lists of length 1 so the
returned mesaging is better.
- check_valid_size() now passes the name variable into check_type
as this is a required argument.

To cover the additional logic within check_type a new test has
been added in the test_validation file.
Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

Thanks Thomas!

@Zac-HD Zac-HD merged commit b1f1be0 into HypothesisWorks:master Sep 9, 2019
@tomgrainge
Copy link
Author

Hey, thanks for getting it past that CI.

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.

Improve argument validation for st.lists()
3 participants