Skip to content

Commit 14c447c

Browse files
committed
TST: pd.test uses pytest
Removes all pandas.util.nosetester as interactive's no longer needed
1 parent c4f6008 commit 14c447c

File tree

4 files changed

+25
-267
lines changed

4 files changed

+25
-267
lines changed

pandas/__init__.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@
5656

5757
from pandas.io.api import *
5858

59-
# define the testing framework
60-
import pandas.util.testing
61-
from pandas.util.nosetester import NoseTester
62-
test = NoseTester().test
63-
del NoseTester
59+
from pandas.api.test import test
6460

6561
# use the closest tagged version if possible
6662
from ._version import get_versions

pandas/api/test.py

+23
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

+1-1
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

-261
This file was deleted.

0 commit comments

Comments
 (0)