Skip to content

Commit

Permalink
fixed move
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger committed Oct 2, 2018
1 parent ce1a3c6 commit 5372134
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pandas/tests/extension/decimal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .array import DecimalArray, DecimalDtype
from .array import DecimalArray, DecimalDtype, to_decimal, make_data


__all__ = ['DecimalArray', 'DecimalDtype', 'to_decimal', 'make_data']
5 changes: 5 additions & 0 deletions pandas/tests/extension/decimal/array.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import decimal
import numbers
import random
import sys

import numpy as np
Expand Down Expand Up @@ -142,5 +143,9 @@ def to_decimal(values, context=None):
return DecimalArray([decimal.Decimal(x) for x in values], context=context)


def make_data():
return [decimal.Decimal(random.random()) for _ in range(100)]


DecimalArray._add_arithmetic_ops()
DecimalArray._add_comparison_ops()
7 changes: 1 addition & 6 deletions pandas/tests/extension/decimal/test_decimal.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import operator
import decimal

import random
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest

from pandas.tests.extension import base

from .array import DecimalDtype, DecimalArray


def make_data():
return [decimal.Decimal(random.random()) for _ in range(100)]
from .array import DecimalDtype, DecimalArray, make_data


@pytest.fixture
Expand Down
9 changes: 9 additions & 0 deletions pandas/tests/extension/json/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import collections
import itertools
import numbers
import random
import string
import sys

import numpy as np
Expand Down Expand Up @@ -179,3 +181,10 @@ def _values_for_argsort(self):
# cast them to an (N, P) array, instead of an (N,) array of tuples.
frozen = [()] + [tuple(x.items()) for x in self]
return np.array(frozen, dtype=object)[1:]


def make_data():
# TODO: Use a regular dict. See _NDFrameIndexer._setitem_with_indexer
return [collections.UserDict([
(random.choice(string.ascii_letters), random.randint(0, 100))
for _ in range(random.randint(0, 10))]) for _ in range(100)]
11 changes: 1 addition & 10 deletions pandas/tests/extension/json/test_json.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import operator
import collections
import random
import string

import pytest

Expand All @@ -10,18 +8,11 @@
from pandas.compat import PY2, PY36
from pandas.tests.extension import base

from .array import JSONArray, JSONDtype
from .array import JSONArray, JSONDtype, make_data

pytestmark = pytest.mark.skipif(PY2, reason="Py2 doesn't have a UserDict")


def make_data():
# TODO: Use a regular dict. See _NDFrameIndexer._setitem_with_indexer
return [collections.UserDict([
(random.choice(string.ascii_letters), random.randint(0, 100))
for _ in range(random.randint(0, 10))]) for _ in range(100)]


@pytest.fixture
def dtype():
return JSONDtype()
Expand Down

0 comments on commit 5372134

Please sign in to comment.