Skip to content

Commit

Permalink
Fix import format at pandas/tests/extension directory (pandas-dev#23365)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwoss authored and Pingviinituutti committed Feb 28, 2019
1 parent 9740a48 commit 778610d
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 62 deletions.
3 changes: 2 additions & 1 deletion pandas/tests/extension/arrow/bool.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

import numpy as np
import pyarrow as pa

import pandas as pd
from pandas.api.extensions import (
ExtensionDtype, ExtensionArray, take, register_extension_dtype
ExtensionArray, ExtensionDtype, register_extension_dtype, take
)


Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/extension/arrow/test_bool.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import numpy as np
import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas.tests.extension import base

pytest.importorskip('pyarrow', minversion="0.10.0")

from .bool import ArrowBoolDtype, ArrowBoolArray
from .bool import ArrowBoolArray, ArrowBoolDtype


@pytest.fixture
Expand All @@ -17,7 +18,7 @@ def dtype():
@pytest.fixture
def data():
return ArrowBoolArray.from_scalars(np.random.randint(0, 2, size=100,
dtype=bool))
dtype=bool))


@pytest.fixture
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/extension/base/dtype.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import warnings

import numpy as np

import pandas as pd

from .base import BaseExtensionTests
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/extension/base/getitem.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
import numpy as np
import pytest

import pandas as pd
import pandas.util.testing as tm
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/extension/base/groupby.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pytest

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

from .base import BaseExtensionTests


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/extension/base/methods.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
import numpy as np
import pytest

import pandas as pd
import pandas.util.testing as tm
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/extension/base/ops.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import pytest

import operator

import pytest

import pandas as pd
from pandas.core import ops

from .base import BaseExtensionTests


Expand Down
5 changes: 4 additions & 1 deletion pandas/tests/extension/base/reduce.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import warnings

import pytest
import pandas.util.testing as tm

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

from .base import BaseExtensionTests


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/extension/base/reshaping.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
import numpy as np
import pytest

import pandas as pd
from pandas.core.internals import ExtensionBlock
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/extension/base/setitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

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

from .base import BaseExtensionTests


Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/extension/decimal/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import numpy as np

import pandas as pd
from pandas.core.arrays import (ExtensionArray,
ExtensionScalarOpsMixin)
from pandas.core.arrays import ExtensionArray, ExtensionScalarOpsMixin
from pandas.core.dtypes.base import ExtensionDtype


Expand Down
10 changes: 5 additions & 5 deletions pandas/tests/extension/decimal/test_decimal.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import operator
import decimal
import operator

import numpy as np
import pandas as pd
from pandas import compat
import pandas.util.testing as tm
import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas import compat
from pandas.tests.extension import base

from .array import DecimalDtype, DecimalArray, make_data, to_decimal
from .array import DecimalArray, DecimalDtype, make_data, to_decimal


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/extension/json/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import numpy as np

from pandas import compat
from pandas.core.dtypes.base import ExtensionDtype
from pandas.core.arrays import ExtensionArray
from pandas.core.dtypes.base import ExtensionDtype


class JSONDtype(ExtensionDtype):
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/extension/json/test_json.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import operator
import collections
import operator

import pytest

Expand Down
8 changes: 4 additions & 4 deletions pandas/tests/extension/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"""
import string

import pytest
import pandas as pd
import numpy as np
import pytest

from pandas.api.types import CategoricalDtype
import pandas as pd
import pandas.util.testing as tm
from pandas import Categorical
from pandas.api.types import CategoricalDtype
from pandas.tests.extension import base
import pandas.util.testing as tm


def make_data():
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/extension/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import pandas as pd
import pandas.util.testing as tm
from pandas.core.arrays import ExtensionArray
from pandas.core.dtypes.common import is_extension_array_dtype
from pandas.core.dtypes import dtypes
from pandas.core.dtypes.common import is_extension_array_dtype


class DummyDtype(dtypes.ExtensionDtype):
Expand Down
6 changes: 2 additions & 4 deletions pandas/tests/extension/test_external_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
# pylint: disable=W0102

import numpy as np
import pytest

import pandas as pd
from pandas.core.internals import (
BlockManager, SingleBlockManager)
from pandas.core.internals import BlockManager, SingleBlockManager
from pandas.core.internals.blocks import Block, NonConsolidatableMixIn

import pytest


class CustomBlock(NonConsolidatableMixIn, Block):

Expand Down
12 changes: 6 additions & 6 deletions pandas/tests/extension/test_integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
"""
import numpy as np
import pandas as pd
import pytest

from pandas.tests.extension import base
from pandas.core.dtypes.common import is_extension_array_dtype

import pandas as pd
from pandas.core.arrays import integer_array
from pandas.core.arrays.integer import (
Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype,
UInt8Dtype, UInt16Dtype, UInt32Dtype, UInt64Dtype)
Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, UInt8Dtype, UInt16Dtype,
UInt32Dtype, UInt64Dtype
)
from pandas.core.dtypes.common import is_extension_array_dtype
from pandas.tests.extension import base


def make_data():
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/extension/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
be added to the array-specific tests in `pandas/tests/arrays/`.
"""
import pytest
import numpy as np
import pytest

import pandas.util.testing as tm
from pandas import Interval
from pandas.core.arrays import IntervalArray
from pandas.core.dtypes.dtypes import IntervalDtype
from pandas.tests.extension import base
import pandas.util.testing as tm


def make_data():
Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/extension/test_sparse.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import pytest
import pandas as pd
import numpy as np
import pytest

import pandas as pd
import pandas.util.testing as tm
from pandas import SparseArray, SparseDtype
from pandas.errors import PerformanceWarning
from pandas.tests.extension import base
import pandas.util.testing as tm


def make_data(fill_value):
Expand Down
25 changes: 2 additions & 23 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ skip=
pandas/tests/indexes/timedeltas/test_partial_slicing.py,
pandas/tests/indexes/timedeltas/test_timedelta_range.py,
pandas/tests/indexes/timedeltas/test_ops.py,
pandas/tests/series/test_duplicates.py,
pandas/tests/series/indexing/test_callable.py,
pandas/tests/arrays/test_datetimelike.py,
pandas/tests/arrays/test_integer.py,
Expand All @@ -255,29 +256,6 @@ skip=
pandas/tests/util/test_testing.py,
pandas/tests/util/test_util.py,
pandas/tests/util/test_hashing.py,
pandas/tests/series/test_duplicates.py
pandas/tests/extension/test_common.py,
pandas/tests/extension/test_integer.py,
pandas/tests/extension/test_external_block.py,
pandas/tests/extension/test_interval.py,
pandas/tests/extension/test_categorical.py,
pandas/tests/extension/base/ops.py,
pandas/tests/extension/base/reshaping.py,
pandas/tests/extension/base/getitem.py,
pandas/tests/extension/base/groupby.py,
pandas/tests/extension/base/constructors.py,
pandas/tests/extension/base/interface.py,
pandas/tests/extension/base/dtype.py,
pandas/tests/extension/base/casting.py,
pandas/tests/extension/base/methods.py,
pandas/tests/extension/base/missing.py,
pandas/tests/extension/base/setitem.py,
pandas/tests/extension/arrow/test_bool.py,
pandas/tests/extension/arrow/bool.py,
pandas/tests/extension/decimal/array.py,
pandas/tests/extension/decimal/test_decimal.py,
pandas/tests/extension/json/array.py,
pandas/tests/extension/json/test_json.py,
pandas/tests/io/test_clipboard.py,
pandas/tests/io/test_compression.py,
pandas/tests/io/test_pytables.py,
Expand Down Expand Up @@ -483,3 +461,4 @@ skip=
pandas/plotting/_misc.py,
pandas/types/common.py,
pandas/plotting/_compat.py,
pandas/tests/extension/arrow/test_bool.py

0 comments on commit 778610d

Please sign in to comment.