Skip to content

Commit

Permalink
Run isort on tests/indexes (pandas-dev#24531)
Browse files Browse the repository at this point in the history
  • Loading branch information
thoo authored and jreback committed Jan 1, 2019
1 parent b9284a2 commit 091cfbb
Show file tree
Hide file tree
Showing 34 changed files with 107 additions and 128 deletions.
8 changes: 4 additions & 4 deletions pandas/tests/indexes/interval/test_astype.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import numpy as np
import pytest

import pandas.util.testing as tm
from pandas.core.dtypes.dtypes import CategoricalDtype, IntervalDtype

from pandas import (
CategoricalIndex, Index, IntervalIndex, NaT, Timedelta, Timestamp,
interval_range
)
from pandas.core.dtypes.dtypes import CategoricalDtype, IntervalDtype
interval_range)
import pandas.util.testing as tm


class Base(object):
Expand Down
15 changes: 8 additions & 7 deletions pandas/tests/indexes/interval/test_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
import numpy as np
import pytest

import pandas.core.common as com
import pandas.util.testing as tm
from pandas import (
Categorical, CategoricalIndex, Float64Index, Index, Int64Index, Interval,
IntervalIndex, date_range, notna, period_range, timedelta_range
)
from pandas.compat import lzip
from pandas.core.arrays import IntervalArray

from pandas.core.dtypes.common import is_categorical_dtype
from pandas.core.dtypes.dtypes import IntervalDtype

from pandas import (
Categorical, CategoricalIndex, Float64Index, Index, Int64Index, Interval,
IntervalIndex, date_range, notna, period_range, timedelta_range)
from pandas.core.arrays import IntervalArray
import pandas.core.common as com
import pandas.util.testing as tm


@pytest.fixture(params=[None, 'foo'])
def name(request):
Expand Down
12 changes: 6 additions & 6 deletions pandas/tests/indexes/interval/test_interval.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
from __future__ import division

import re
from itertools import permutations
import re

import numpy as np
import pytest

from pandas.compat import lzip

import pandas as pd
import pandas.core.common as com
import pandas.util.testing as tm
from pandas import (
Index, Interval, IntervalIndex, Timedelta, Timestamp, date_range,
interval_range, isna, notna, timedelta_range
)
from pandas.compat import lzip
interval_range, isna, notna, timedelta_range)
import pandas.core.common as com
from pandas.tests.indexes.common import Base
import pandas.util.testing as tm


@pytest.fixture(scope='class', params=[None, 'foo'])
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/interval/test_interval_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import numpy as np
import pytest

import pandas.util.testing as tm
from pandas import Int64Index, Interval, IntervalIndex
import pandas.util.testing as tm

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

Expand Down
9 changes: 5 additions & 4 deletions pandas/tests/indexes/interval/test_interval_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
import numpy as np
import pytest

import pandas.util.testing as tm
from pandas.core.dtypes.common import is_integer

from pandas import (
DateOffset, Interval, IntervalIndex, Timedelta, Timestamp, date_range,
interval_range, timedelta_range
)
from pandas.core.dtypes.common import is_integer
interval_range, timedelta_range)
import pandas.util.testing as tm

from pandas.tseries.offsets import Day


Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/indexes/interval/test_interval_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import numpy as np
import pytest

import pandas.util.testing as tm
from pandas import compat
from pandas._libs.interval import IntervalTree

from pandas import compat
import pandas.util.testing as tm


def skipif_32bit(param):
"""
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/indexes/multi/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import numpy as np
import pytest

from pandas.compat import lrange

import pandas as pd
import pandas.util.testing as tm
from pandas import Index, MultiIndex, date_range, period_range
from pandas.compat import lrange
import pandas.util.testing as tm


def test_shift(idx):
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/indexes/multi/test_astype.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pytest

from pandas.core.dtypes.dtypes import CategoricalDtype

from pandas.util.testing import assert_copy


Expand Down
7 changes: 4 additions & 3 deletions pandas/tests/indexes/multi/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

from collections import OrderedDict

import pytest
import numpy as np
import pytest

from pandas.compat import range

import pandas as pd
import pandas.util.testing as tm
from pandas import DataFrame, MultiIndex, date_range
from pandas.compat import range
import pandas.util.testing as tm


def test_tolist(idx):
Expand Down
7 changes: 4 additions & 3 deletions pandas/tests/indexes/multi/test_drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import numpy as np
import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas import Index, MultiIndex
from pandas.compat import lrange
from pandas.errors import PerformanceWarning

import pandas as pd
from pandas import Index, MultiIndex
import pandas.util.testing as tm


def test_drop(idx):
dropped = idx.drop([('foo', 'two'), ('qux', 'one')])
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/indexes/multi/test_duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
import numpy as np
import pytest

import pandas.util.testing as tm
from pandas import DatetimeIndex, MultiIndex
from pandas._libs import hashtable
from pandas.compat import range, u

from pandas import DatetimeIndex, MultiIndex
import pandas.util.testing as tm


@pytest.mark.parametrize('names', [None, ['first', 'second']])
def test_unique(names):
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/indexes/multi/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

import pytest

from pandas.compat import PY3, range, u

import pandas as pd
import pandas.util.testing as tm
from pandas import MultiIndex, compat
from pandas.compat import PY3, range, u
import pandas.util.testing as tm


def test_dtype_str(indices):
Expand Down
8 changes: 5 additions & 3 deletions pandas/tests/indexes/multi/test_integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import numpy as np
import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas import IntervalIndex, MultiIndex, RangeIndex
from pandas.compat import lrange, range

from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike

import pandas as pd
from pandas import IntervalIndex, MultiIndex, RangeIndex
import pandas.util.testing as tm


def test_labels_dtypes():

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/multi/test_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas import Index, MultiIndex
import pandas.util.testing as tm


@pytest.mark.parametrize('other', [
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/indexes/multi/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import numpy as np
import pytest

from pandas._libs.tslib import iNaT

import pandas as pd
import pandas.util.testing as tm
from pandas import Int64Index, MultiIndex, PeriodIndex, UInt64Index
from pandas._libs.tslib import iNaT
from pandas.core.indexes.datetimelike import DatetimeIndexOpsMixin
import pandas.util.testing as tm


def test_fillna(idx):
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/indexes/multi/test_names.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-

import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas import MultiIndex
import pandas.util.testing as tm


def check_level_names(index, names):
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/multi/test_partial_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas import DataFrame, MultiIndex, date_range
import pandas.util.testing as tm


def test_partial_string_timestamp_multiindex():
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/indexes/multi/test_reindex.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-

import pytest
import numpy as np
import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas import Index, MultiIndex
import pandas.util.testing as tm


def check_level_names(index, names):
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/multi/test_reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas import Index, MultiIndex
import pandas.util.testing as tm


def test_insert(idx):
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/indexes/multi/test_set_ops.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-

import pytest
import numpy as np
import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas import MultiIndex, Series
import pandas.util.testing as tm


@pytest.mark.parametrize("case", [0.5, "xxx"])
Expand Down
28 changes: 13 additions & 15 deletions pandas/tests/indexes/test_base.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
# -*- coding: utf-8 -*-

import math
from collections import defaultdict
from datetime import datetime, timedelta
from decimal import Decimal
import math

import numpy as np
import pytest

import pandas as pd
import pandas.core.config as cf
import pandas.util.testing as tm
from pandas import (
CategoricalIndex, DataFrame, DatetimeIndex, Float64Index, Int64Index,
PeriodIndex, RangeIndex, Series, TimedeltaIndex, UInt64Index, date_range,
isna, period_range,
)
from pandas._libs.tslib import Timestamp
from pandas.compat import (
PY3, PY35, PY36, StringIO, lrange, lzip, range, text_type, u, zip
)
PY3, PY35, PY36, StringIO, lrange, lzip, range, text_type, u, zip)
from pandas.compat.numpy import np_datetime64_compat
from pandas.core.dtypes.common import (
is_unsigned_integer_dtype,
)

from pandas.core.dtypes.common import is_unsigned_integer_dtype
from pandas.core.dtypes.generic import ABCIndex

import pandas as pd
from pandas import (
CategoricalIndex, DataFrame, DatetimeIndex, Float64Index, Int64Index,
PeriodIndex, RangeIndex, Series, TimedeltaIndex, UInt64Index, date_range,
isna, period_range)
import pandas.core.config as cf
from pandas.core.index import _get_combined_index, ensure_index_from_sequences
from pandas.core.indexes.api import Index, MultiIndex
from pandas.core.sorting import safe_sort
from pandas.tests.indexes.common import Base
import pandas.util.testing as tm
from pandas.util.testing import assert_almost_equal
from pandas.core.sorting import safe_sort


class TestIndex(Base):
Expand Down
10 changes: 6 additions & 4 deletions pandas/tests/indexes/test_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
import numpy as np
import pytest

import pandas as pd
import pandas.core.config as cf
import pandas.util.testing as tm
from pandas import Categorical, IntervalIndex, compat
from pandas._libs import index as libindex
from pandas.compat import PY3, range

from pandas.core.dtypes.dtypes import CategoricalDtype

import pandas as pd
from pandas import Categorical, IntervalIndex, compat
import pandas.core.config as cf
from pandas.core.indexes.api import CategoricalIndex, Index
import pandas.util.testing as tm
from pandas.util.testing import assert_almost_equal

from .common import Base
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/indexes/test_frozen.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import warnings

import numpy as np

from pandas.compat import u

from pandas.core.indexes.frozen import FrozenList, FrozenNDArray
from pandas.tests.test_base import CheckImmutable, CheckStringMixin
from pandas.util import testing as tm
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/indexes/timedeltas/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import numpy as np
import pytest

from pandas.errors import NullFrequencyError

import pandas as pd
import pandas.util.testing as tm
from pandas import Timedelta, TimedeltaIndex, timedelta_range
from pandas.errors import NullFrequencyError
import pandas.util.testing as tm


@pytest.fixture(params=[pd.offsets.Hour(2), timedelta(hours=2),
Expand Down
Loading

0 comments on commit 091cfbb

Please sign in to comment.