-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: collect ordered fixtures in pandas.conftest #26082
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
Conversation
0cf776e
to
e37722b
Compare
pandas/conftest.py
Outdated
@@ -126,6 +126,12 @@ def observed(request): | |||
return request.param | |||
|
|||
|
|||
@pytest.fixture(params=[True, False, None]) | |||
def ordered(request): |
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.
I think this could be more generic than ordered
since it would have applications for other parameters. Maybe something like optional_bool
would be more fitting?
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.
I see your point, but there are also benefits of naming the fixture after the parameter being parametrized and not sharing. For example, if e.g. if 10 parametrizations would share a fixture and then one would change its signature, it would be more difficult to find where its fixture is used.
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.
I agree with @topper-123 here. This is fine.
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.
this is consistent as it’s naming is specific to its use; could name it ordered_fixture though as we use this particular nomenclature
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.
see comment
e37722b
to
4389495
Compare
4389495
to
781773b
Compare
Codecov Report
@@ Coverage Diff @@
## master #26082 +/- ##
===========================================
- Coverage 91.96% 40.73% -51.23%
===========================================
Files 175 175
Lines 52405 52405
===========================================
- Hits 48192 21345 -26847
- Misses 4213 31060 +26847
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26082 +/- ##
==========================================
- Coverage 91.96% 91.95% -0.01%
==========================================
Files 175 175
Lines 52405 52405
==========================================
- Hits 48192 48188 -4
- Misses 4213 4217 +4
Continue to review full report at Codecov.
|
I’ve changed the name of the fixture. |
thanks @topper-123 |
Currently,
Categorical .ordered
,CategoricaDtype.ordered
and similar is tested using different fixtures + parametrization in some places. This PR collects the ordered fixtures/parametrizations and places a commonordered
fixture in pandas.conftest.