Skip to content

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

Closed
@evectant

Description

@evectant

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Testingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions