Skip to content

TST: indexes/test_base.py:TestIndex.test_format is flaky #14626

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

Closed
evectant opened this issue Nov 9, 2016 · 1 comment
Closed

TST: indexes/test_base.py:TestIndex.test_format is flaky #14626

evectant opened this issue Nov 9, 2016 · 1 comment
Labels
Testing pandas testing functions or related to the test suite
Milestone

Comments

@evectant
Copy link
Contributor

evectant commented Nov 9, 2016

indexes/test_base.py:TestIndex.test_format compares index.format() and str(index[0]), where index = Index([datetime.now()]). These won't match if the current timestamp ends with zeros:

In [2]: i = pd.Index([pd.Timestamp('2012-01-01 00:00:00.111111')])

In [3]: j = pd.Index([pd.Timestamp('2012-01-01 00:00:00.111000')])

In [4]: i.format(), [str(i[0])]
Out[4]: (['2012-01-01 00:00:00.111111'], ['2012-01-01 00:00:00.111111'])

In [5]: j.format(), [str(j[0])]
Out[5]: (['2012-01-01 00:00:00.111'], ['2012-01-01 00:00:00.111000'])

Same thing for real: https://travis-ci.org/pandas-dev/pandas/jobs/173440088#L1355

@jreback
Copy link
Contributor

jreback commented Nov 9, 2016

yeah this does occasionally fail

it's not a great test, but is testing the default behavior so no easy way to control the formatting
maybe put this in a while loop and get a new time if the current time ends with 000

put a short explanation there

@jreback jreback added Difficulty Novice Testing pandas testing functions or related to the test suite labels Nov 9, 2016
@jreback jreback added this to the Next Major Release milestone Nov 9, 2016
@jreback jreback modified the milestones: 0.19.2, Next Major Release Nov 12, 2016
jreback added a commit to jreback/pandas that referenced this issue Dec 10, 2016
jreback added a commit to jreback/pandas that referenced this issue Dec 10, 2016
jorisvandenbossche pushed a commit to jorisvandenbossche/pandas that referenced this issue Dec 14, 2016
closes pandas-dev#14626

Author: Mykola Golubyev <[email protected]>

Closes pandas-dev#14638 from MykolaGolubyev/issue-14626 and squashes the following commits:

166ec23 [Mykola Golubyev] Inline datetime_now_without_trailing_zeros within test_format
68a72a7 [Mykola Golubyev] Fix trailing current date zeros flaky test_format problem

(cherry picked from commit 3552dc0)
jorisvandenbossche pushed a commit that referenced this issue Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants