Skip to content

Commit 47e45ed

Browse files
thoojreback
authored andcommitted
Fix import format tests/indexes/multi Part Two (#23339)
1 parent 1a7165a commit 47e45ed

38 files changed

+121
-98
lines changed

pandas/tests/indexes/interval/test_astype.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
from __future__ import division
22

3-
import pytest
43
import numpy as np
4+
import pytest
5+
6+
import pandas.util.testing as tm
57
from pandas import (
6-
Index,
7-
IntervalIndex,
8-
interval_range,
9-
CategoricalIndex,
10-
Timestamp,
11-
Timedelta,
12-
NaT)
8+
CategoricalIndex, Index, IntervalIndex, NaT, Timedelta, Timestamp,
9+
interval_range
10+
)
1311
from pandas.core.dtypes.dtypes import CategoricalDtype, IntervalDtype
14-
import pandas.util.testing as tm
1512

1613

1714
class Base(object):

pandas/tests/indexes/interval/test_construction.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
from __future__ import division
22

3-
import pytest
4-
import numpy as np
53
from functools import partial
64

5+
import numpy as np
6+
import pytest
7+
8+
import pandas.core.common as com
9+
import pandas.util.testing as tm
710
from pandas import (
8-
Interval, IntervalIndex, Index, Int64Index, Float64Index, Categorical,
9-
CategoricalIndex, date_range, timedelta_range, period_range, notna)
11+
Categorical, CategoricalIndex, Float64Index, Index, Int64Index, Interval,
12+
IntervalIndex, date_range, notna, period_range, timedelta_range
13+
)
1014
from pandas.compat import lzip
1115
from pandas.core.arrays import IntervalArray
1216
from pandas.core.dtypes.common import is_categorical_dtype
1317
from pandas.core.dtypes.dtypes import IntervalDtype
14-
import pandas.core.common as com
15-
import pandas.util.testing as tm
1618

1719

1820
@pytest.fixture(params=[None, 'foo'])

pandas/tests/indexes/interval/test_interval.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
from __future__ import division
22

3+
import re
34
from itertools import permutations
4-
import pytest
5+
56
import numpy as np
6-
import re
7+
import pytest
8+
9+
import pandas as pd
10+
import pandas.core.common as com
11+
import pandas.util.testing as tm
712
from pandas import (
8-
Interval, IntervalIndex, Index, isna, notna, interval_range, Timestamp,
9-
Timedelta, date_range, timedelta_range)
13+
Index, Interval, IntervalIndex, Timedelta, Timestamp, date_range,
14+
interval_range, isna, notna, timedelta_range
15+
)
1016
from pandas.compat import lzip
11-
import pandas.core.common as com
1217
from pandas.tests.indexes.common import Base
13-
import pandas.util.testing as tm
14-
import pandas as pd
1518

1619

1720
@pytest.fixture(scope='class', params=[None, 'foo'])

pandas/tests/indexes/interval/test_interval_new.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from __future__ import division
22

3-
import pytest
43
import numpy as np
4+
import pytest
55

6-
from pandas import Interval, IntervalIndex, Int64Index
76
import pandas.util.testing as tm
8-
7+
from pandas import Int64Index, Interval, IntervalIndex
98

109
pytestmark = pytest.mark.skip(reason="new indexing tests for issue 16316")
1110

pandas/tests/indexes/interval/test_interval_range.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
from __future__ import division
22

3-
import pytest
4-
import numpy as np
53
from datetime import timedelta
4+
5+
import numpy as np
6+
import pytest
7+
8+
import pandas.util.testing as tm
69
from pandas import (
7-
Interval, IntervalIndex, Timestamp, Timedelta, DateOffset,
8-
interval_range, date_range, timedelta_range)
10+
DateOffset, Interval, IntervalIndex, Timedelta, Timestamp, date_range,
11+
interval_range, timedelta_range
12+
)
913
from pandas.core.dtypes.common import is_integer
1014
from pandas.tseries.offsets import Day
11-
import pandas.util.testing as tm
1215

1316

1417
@pytest.fixture(scope='class', params=[None, 'foo'])

pandas/tests/indexes/interval/test_interval_tree.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from __future__ import division
22

3-
import pytest
43
import numpy as np
4+
import pytest
5+
6+
import pandas.util.testing as tm
57
from pandas import compat
68
from pandas._libs.interval import IntervalTree
7-
import pandas.util.testing as tm
89

910

1011
@pytest.fixture(

pandas/tests/indexes/multi/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import numpy as np
44
import pytest
5+
56
from pandas import Index, MultiIndex
67

78

pandas/tests/indexes/multi/test_analytics.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# -*- coding: utf-8 -*-
22

33
import numpy as np
4+
import pytest
5+
46
import pandas as pd
57
import pandas.util.testing as tm
6-
import pytest
78
from pandas import Index, MultiIndex, date_range, period_range
89
from pandas.compat import lrange
910

pandas/tests/indexes/multi/test_astype.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# -*- coding: utf-8 -*-
22

33
import numpy as np
4-
import pandas.util.testing as tm
54
import pytest
6-
from pandas.util.testing import assert_copy
5+
6+
import pandas.util.testing as tm
77
from pandas.core.dtypes.dtypes import CategoricalDtype
8+
from pandas.util.testing import assert_copy
89

910

1011
def test_astype(idx):

pandas/tests/indexes/multi/test_compat.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33

44
import numpy as np
5-
import pandas.util.testing as tm
65
import pytest
6+
7+
import pandas.util.testing as tm
78
from pandas import MultiIndex
89
from pandas.compat import PY3, long
910

pandas/tests/indexes/multi/test_constructor.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import re
44

55
import numpy as np
6+
import pytest
7+
68
import pandas as pd
79
import pandas.util.testing as tm
8-
import pytest
910
from pandas import Index, MultiIndex, date_range
1011
from pandas._libs.tslib import Timestamp
1112
from pandas.compat import lrange, range

pandas/tests/indexes/multi/test_contains.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# -*- coding: utf-8 -*-
22

33
import numpy as np
4+
import pytest
5+
46
import pandas as pd
57
import pandas.util.testing as tm
6-
import pytest
78
from pandas import MultiIndex
89
from pandas.compat import PYPY
910

pandas/tests/indexes/multi/test_conversion.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
import numpy as np
5+
56
import pandas as pd
67
import pandas.util.testing as tm
78
from pandas import DataFrame, MultiIndex, date_range

pandas/tests/indexes/multi/test_copy.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
from copy import copy, deepcopy
44

5-
import pandas.util.testing as tm
65
import pytest
6+
7+
import pandas.util.testing as tm
78
from pandas import MultiIndex
89

910

pandas/tests/indexes/multi/test_drop.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33

44
import numpy as np
5+
import pytest
6+
57
import pandas as pd
68
import pandas.util.testing as tm
7-
import pytest
89
from pandas import Index, MultiIndex
910
from pandas.compat import lrange
1011
from pandas.errors import PerformanceWarning

pandas/tests/indexes/multi/test_duplicates.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# -*- coding: utf-8 -*-
22

33
from itertools import product
4-
import pytest
54

65
import numpy as np
6+
import pytest
77

8-
from pandas.compat import range, u
9-
from pandas import MultiIndex, DatetimeIndex
10-
from pandas._libs import hashtable
118
import pandas.util.testing as tm
9+
from pandas import DatetimeIndex, MultiIndex
10+
from pandas._libs import hashtable
11+
from pandas.compat import range, u
1212

1313

1414
@pytest.mark.parametrize('names', [None, ['first', 'second']])

pandas/tests/indexes/multi/test_equivalence.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
import numpy as np
5+
56
import pandas as pd
67
import pandas.util.testing as tm
78
from pandas import Index, MultiIndex, Series

pandas/tests/indexes/multi/test_get_set.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33

44
import numpy as np
5+
import pytest
6+
57
import pandas as pd
68
import pandas.util.testing as tm
7-
import pytest
89
from pandas import CategoricalIndex, Index, MultiIndex
910
from pandas.compat import range
1011

pandas/tests/indexes/multi/test_indexing.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88

99
import pandas as pd
1010
import pandas.util.testing as tm
11-
from pandas import (Categorical, CategoricalIndex, Index, IntervalIndex,
12-
MultiIndex, date_range)
11+
from pandas import (
12+
Categorical, CategoricalIndex, Index, IntervalIndex, MultiIndex,
13+
date_range
14+
)
1315
from pandas.compat import lrange
1416
from pandas.core.indexes.base import InvalidIndexError
1517
from pandas.util.testing import assert_almost_equal

pandas/tests/indexes/multi/test_integrity.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import re
44

55
import numpy as np
6+
import pytest
7+
68
import pandas as pd
79
import pandas.util.testing as tm
8-
import pytest
910
from pandas import IntervalIndex, MultiIndex, RangeIndex
1011
from pandas.compat import lrange, range
1112
from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike

pandas/tests/indexes/multi/test_join.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33

44
import numpy as np
5+
import pytest
6+
57
import pandas as pd
68
import pandas.util.testing as tm
7-
import pytest
89
from pandas import Index, MultiIndex
910

1011

pandas/tests/indexes/multi/test_missing.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# -*- coding: utf-8 -*-
22

33
import numpy as np
4+
import pytest
5+
46
import pandas as pd
57
import pandas.util.testing as tm
6-
import pytest
78
from pandas import Int64Index, MultiIndex, PeriodIndex, UInt64Index
89
from pandas._libs.tslib import iNaT
910
from pandas.core.indexes.datetimelike import DatetimeIndexOpsMixin

pandas/tests/indexes/multi/test_monotonic.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# -*- coding: utf-8 -*-
22

33
import numpy as np
4-
import pandas as pd
54
import pytest
5+
6+
import pandas as pd
67
from pandas import Index, IntervalIndex, MultiIndex
78

89

pandas/tests/indexes/multi/test_reindex.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
import numpy as np
5+
56
import pandas as pd
67
import pandas.util.testing as tm
78
from pandas import Index, MultiIndex

pandas/tests/indexes/multi/test_set_ops.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
import numpy as np
4+
45
import pandas as pd
56
import pandas.util.testing as tm
67
from pandas import MultiIndex, Series

pandas/tests/indexes/multi/test_sorting.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# -*- coding: utf-8 -*-
22
import numpy as np
3+
import pytest
4+
35
import pandas as pd
46
import pandas.util.testing as tm
5-
import pytest
67
from pandas import CategoricalIndex, DataFrame, Index, MultiIndex, RangeIndex
78
from pandas.compat import lrange
89
from pandas.errors import PerformanceWarning, UnsortedIndexError

pandas/tests/indexes/timedeltas/test_arithmetic.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# -*- coding: utf-8 -*-
22

3-
import pytest
4-
import numpy as np
53
from datetime import timedelta
64
from distutils.version import LooseVersion
75

6+
import numpy as np
7+
import pytest
8+
89
import pandas as pd
910
import pandas.util.testing as tm
10-
from pandas import (DatetimeIndex, TimedeltaIndex, Int64Index,
11-
timedelta_range, date_range,
12-
Series,
13-
Timestamp, Timedelta)
11+
from pandas import (
12+
DatetimeIndex, Int64Index, Series, Timedelta, TimedeltaIndex, Timestamp,
13+
date_range, timedelta_range
14+
)
1415
from pandas.errors import NullFrequencyError
1516

1617

pandas/tests/indexes/timedeltas/test_astype.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
from datetime import timedelta
22

3-
import pytest
4-
53
import numpy as np
4+
import pytest
65

76
import pandas.util.testing as tm
8-
from pandas import (TimedeltaIndex, timedelta_range, Int64Index, Float64Index,
9-
Index, Timedelta, NaT)
7+
from pandas import (
8+
Float64Index, Index, Int64Index, NaT, Timedelta, TimedeltaIndex,
9+
timedelta_range
10+
)
1011

1112

1213
class TestTimedeltaIndex(object):

0 commit comments

Comments
 (0)