Skip to content

Parametrize shape and size tests #3099

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

Merged
merged 1 commit into from
Jul 15, 2018

Conversation

canyon289
Copy link
Member

@canyon289 canyon289 commented Jul 15, 2018

While working on this pull request #3060, one challenge I'm having is that its really three tests rolled into one. This makes it hard to develop though because if "test 2" fails I can't see the result of test 3.

pytest has a handy parameterize decorator that takes a single tests definition and converts it into N number of independent tests. To me this makes things easier since each assert gets its own pass/fail line

Hopefully this helps make the testing suite more clear to others as well, let me know what you think!

If this change is welcome I can also comb through all the tests and see where else parametrize can be applied

image

@junpenglao junpenglao requested a review from ColCarroll July 15, 2018 18:30
@junpenglao
Copy link
Member

We used it somewhere else in the test and indeed it is a much better way.

@ColCarroll ColCarroll merged commit c0c1ddf into pymc-devs:master Jul 15, 2018
@ColCarroll
Copy link
Member

Looks good - thanks @canyon289 !

@canyon289 canyon289 deleted the parametrize_shape_tests branch July 21, 2018 05:13
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.

3 participants