-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
TST: simplify how the different code paths for block are tested. #12259
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
TST: simplify how the different code paths for block are tested. #12259
Conversation
numpy/core/tests/test_shape_base.py
Outdated
dict(block=_block_force_concatenate), | ||
dict(block=_block_force_slicing)] | ||
@pytest.fixture(params=['block', 'force_concatenate', 'force_slicing']) | ||
def block(request): # maybe needs self, not sure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming this works, should strip this comment out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
man, what a mistake!
623da56
to
75e0e75
Compare
75e0e75
to
ce55462
Compare
@eric-wieser I finally got around to fixing this. I'm glad I was explicit about my tests since it was always falling down to the default case. We needed the |
elif request.param == 'force_slicing': | ||
return _block_force_slicing | ||
elif request.param == 'block': | ||
return block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note you could also achieve this via the ids
parameter to fixture
:
@pytest.fixture(
params=[block, _block_force_concatenate, _block_force_slicing],
ids=['block', 'force_concatenate', 'force_slicing']
)
Which has the benefit of not needing the final else
.
Not really a big deal either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that else statement is more a test on the test. It checks that I know how to use request (which I didn't).
Thanks for the review @eric-wieser |
Thanks @hmaarrfk . |
xref: #11971 (comment)
cc: @eric-wieser