-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
parametrize a whole mess of tests #19785
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
Codecov Report
@@ Coverage Diff @@
## master #19785 +/- ##
==========================================
+ Coverage 91.61% 91.61% +<.01%
==========================================
Files 150 150
Lines 48887 48882 -5
==========================================
- Hits 44786 44782 -4
+ Misses 4101 4100 -1
Continue to review full report at Codecov.
|
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.
looks good, just a couple of comments
@@ -381,18 +380,17 @@ def test_ns_index(self): | |||
freq=index.freq) | |||
self.assert_index_parameters(new_index) | |||
|
|||
def test_join_with_period_index(self): | |||
@pytest.mark.parametrize('how', ['left', 'right', 'inner', 'outer']) |
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 to make a fixture and hence conform ordering of how
for tz in [None, 'UTC', 'US/Eastern', 'Asia/Tokyo']: | ||
base = pd.date_range('2016-11-05', freq='H', periods=100, tz=tz) | ||
idx = base.repeat(5) | ||
@pytest.mark.parametrize('tz', [None, 'UTC', 'US/Eastern', 'Asia/Tokyo']) |
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.
usual note to fixturize tz (in future)
@@ -613,42 +613,42 @@ def test_pi_ops(self): | |||
exp = pd.Index([0, -1, -2, -3], name='idx') | |||
tm.assert_index_equal(result, exp) | |||
|
|||
def test_pi_ops_errors(self): | |||
@pytest.mark.parametrize('ng', ["str", 1.5]) | |||
def test_pi_ops_errors(self, ng): | |||
idx = PeriodIndex(['2011-01', '2011-02', '2011-03', '2011-04'], | |||
freq='M', name='idx') | |||
ser = pd.Series(idx) | |||
|
|||
msg = r"unsupported operand type\(s\)" | |||
|
|||
for obj in [idx, ser]: |
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.
still need this loop here?
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.
There are a bunch of borderline cases like this left for the next pass.
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.
thats fine
assert p.tz == exp.tz | ||
|
||
def test_timestamp_tz_arg_dateutil(self): | ||
@pytest.mark.parametrize('case', ['Europe/Brussels', |
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.
rename to tz
assert p.tz == exp_zone.tzinfo | ||
assert p.tz == exp.tz | ||
|
||
@pytest.mark.parametrize('case', ['dateutil/Europe/Brussels', |
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.
same
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.
There's already a tz
variable in the method; case
is the name used for this in the status quo.
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.
pls change. this is really confusing.
thanks. pls add to the list to move the common fixtures to a higher level (e.g. tz, dtypes) |
What it says on the tin. Because this is a big diff, nothing is moved or changed other than parametrizing tests.