Skip to content

Commit 5372134

Browse files
committed
fixed move
1 parent ce1a3c6 commit 5372134

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .array import DecimalArray, DecimalDtype
1+
from .array import DecimalArray, DecimalDtype, to_decimal, make_data
22

33

44
__all__ = ['DecimalArray', 'DecimalDtype', 'to_decimal', 'make_data']

pandas/tests/extension/decimal/array.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import decimal
22
import numbers
3+
import random
34
import sys
45

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

144145

146+
def make_data():
147+
return [decimal.Decimal(random.random()) for _ in range(100)]
148+
149+
145150
DecimalArray._add_arithmetic_ops()
146151
DecimalArray._add_comparison_ops()

pandas/tests/extension/decimal/test_decimal.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
import operator
22
import decimal
33

4-
import random
54
import numpy as np
65
import pandas as pd
76
import pandas.util.testing as tm
87
import pytest
98

109
from pandas.tests.extension import base
1110

12-
from .array import DecimalDtype, DecimalArray
13-
14-
15-
def make_data():
16-
return [decimal.Decimal(random.random()) for _ in range(100)]
11+
from .array import DecimalDtype, DecimalArray, make_data
1712

1813

1914
@pytest.fixture

pandas/tests/extension/json/array.py

+9
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import collections
1414
import itertools
1515
import numbers
16+
import random
17+
import string
1618
import sys
1719

1820
import numpy as np
@@ -179,3 +181,10 @@ def _values_for_argsort(self):
179181
# cast them to an (N, P) array, instead of an (N,) array of tuples.
180182
frozen = [()] + [tuple(x.items()) for x in self]
181183
return np.array(frozen, dtype=object)[1:]
184+
185+
186+
def make_data():
187+
# TODO: Use a regular dict. See _NDFrameIndexer._setitem_with_indexer
188+
return [collections.UserDict([
189+
(random.choice(string.ascii_letters), random.randint(0, 100))
190+
for _ in range(random.randint(0, 10))]) for _ in range(100)]

pandas/tests/extension/json/test_json.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import operator
22
import collections
3-
import random
4-
import string
53

64
import pytest
75

@@ -10,18 +8,11 @@
108
from pandas.compat import PY2, PY36
119
from pandas.tests.extension import base
1210

13-
from .array import JSONArray, JSONDtype
11+
from .array import JSONArray, JSONDtype, make_data
1412

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

1715

18-
def make_data():
19-
# TODO: Use a regular dict. See _NDFrameIndexer._setitem_with_indexer
20-
return [collections.UserDict([
21-
(random.choice(string.ascii_letters), random.randint(0, 100))
22-
for _ in range(random.randint(0, 10))]) for _ in range(100)]
23-
24-
2516
@pytest.fixture
2617
def dtype():
2718
return JSONDtype()

0 commit comments

Comments
 (0)