Skip to content

Commit 80e7d9a

Browse files
committed
TST: pd.test uses pytest
Removes all pandas.util.nosetester as interactive's no longer needed
1 parent 4cbd593 commit 80e7d9a

File tree

4 files changed

+25
-268
lines changed

4 files changed

+25
-268
lines changed

pandas/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,7 @@
5353
from pandas.tools.util import to_numeric
5454
from pandas.core.reshape import melt
5555
from pandas.util.print_versions import show_versions
56-
57-
# define the testing framework
58-
import pandas.util.testing
59-
from pandas.util.nosetester import NoseTester
60-
test = NoseTester().test
61-
del NoseTester
56+
from pandas.api.test import test
6257

6358
# use the closest tagged version if possible
6459
from ._version import get_versions

pandas/api/test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
Entrypoint for testing from the top-level namespace
3+
"""
4+
import os
5+
6+
PKG = os.path.dirname(os.path.dirname(__file__))
7+
8+
9+
try:
10+
import pytest
11+
except ImportError:
12+
def test():
13+
raise ImportError("Need pytest>=3.0 to run tests")
14+
else:
15+
def test(extra_args=None):
16+
if extra_args:
17+
cmd = ['-q'] + extra_args + [PKG]
18+
else:
19+
cmd = ['-q', PKG]
20+
pytest.main(cmd)
21+
22+
23+
__all__ = ['test']

pandas/api/tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def test_api(self):
133133

134134
class TestApi(Base, tm.TestCase):
135135

136-
allowed = ['tests', 'types']
136+
allowed = ['tests', 'types', 'test']
137137

138138
def test_api(self):
139139

pandas/util/nosetester.py

Lines changed: 0 additions & 261 deletions
This file was deleted.

0 commit comments

Comments
 (0)