Skip to content

Commit 713a105

Browse files
committed
TST: add testing base TestCase to provide global testing config
1 parent b74c420 commit 713a105

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

pandas/tests/test_frame.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ def test_add_prefix_suffix(self):
18721872
self.assert_(np.array_equal(with_suffix.columns, expected))
18731873

18741874

1875-
class TestDataFrame(unittest.TestCase, CheckIndexing,
1875+
class TestDataFrame(tm.TestCase, CheckIndexing,
18761876
SafeForSparse):
18771877
klass = DataFrame
18781878

@@ -12026,15 +12026,18 @@ def check_raise_on_panel4d_with_multiindex(self, parser, engine):
1202612026
pd.eval('p4d + 1', parser=parser, engine=engine)
1202712027

1202812028

12029-
class TestDataFrameQueryNumExprPandas(unittest.TestCase):
12029+
class TestDataFrameQueryNumExprPandas(tm.TestCase):
12030+
1203012031
@classmethod
1203112032
def setUpClass(cls):
12033+
super(TestDataFrameQueryNumExprPandas, cls).setUpClass()
1203212034
cls.engine = 'numexpr'
1203312035
cls.parser = 'pandas'
1203412036
skip_if_no_ne()
1203512037

1203612038
@classmethod
1203712039
def tearDownClass(cls):
12040+
super(TestDataFrameQueryNumExprPandas, cls).tearDownClass()
1203812041
del cls.engine, cls.parser
1203912042

1204012043
def test_date_query_method(self):

pandas/util/testing.py

+12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import os
1212
import subprocess
1313
import locale
14+
import unittest
1415

1516
from datetime import datetime
1617
from functools import wraps, partial
@@ -52,6 +53,17 @@
5253
K = 4
5354
_RAISE_NETWORK_ERROR_DEFAULT = False
5455

56+
class TestCase(unittest.TestCase):
57+
58+
@classmethod
59+
def setUpClass(cls):
60+
pd.set_option('chained_assignment','raise')
61+
print("setting up: {0}".format(cls))
62+
63+
@classmethod
64+
def tearDownClass(cls):
65+
pass
66+
5567
# NOTE: don't pass an NDFrame or index to this function - may not handle it
5668
# well.
5769
assert_almost_equal = _testing.assert_almost_equal

0 commit comments

Comments
 (0)