Skip to content

CLN: Consistent imports in tests: pandas.util.testing as tm #29272

Closed
@SaturnFromTitan

Description

@SaturnFromTitan

This is a follow-up issue of #23018 with the goal of enforcing a consistent approach of importing things from pandas.util.testing inside the test suite.

Currently, there are multiple import styles used:

  1. import pandas.util.testing as tm
  2. from pandas.util.testing import ...
  3. from pandas.util import testing as tm

As it is already the dominant import style used and also less prone to circular imports 1. is the prefered option. After migrating all current occurrences of 2. and 3. we'll add a linting rule that enforces this convention.

These are the current files that use 2. (generated with grep -R -l --include="*.py" "from pandas.util.testing import " pandas/tests:

Metadata

Metadata

Assignees

No one assigned

    Labels

    CleanTestingpandas 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