summaryrefslogtreecommitdiff
path: root/numpy/tests/test_public_api.py
diff options
context:
space:
mode:
authorSanthoshBala18 <santhoshbala18@gmail.com>2020-01-28 13:20:56 +0530
committerSebastian Berg <sebastian@sipsolutions.net>2020-01-27 23:50:56 -0800
commitd67de1bfaaa8b9e01c367c34bf76ff86124bf8dc (patch)
tree30eb847d4541b4b961de624056e68b34553768f1 /numpy/tests/test_public_api.py
parent79eff02e7e2c3b1865ee47fa66ae40f44894cadb (diff)
downloadnumpy-d67de1bfaaa8b9e01c367c34bf76ff86124bf8dc.tar.gz
MAINT: dir(numpy) returned duplicate "testing" (gh-15425)
Modified __dir__() to remove duplicate "Tester/Testing" attribute. Also added a test to verify this. Closes gh-15383
Diffstat (limited to 'numpy/tests/test_public_api.py')
-rw-r--r--numpy/tests/test_public_api.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/tests/test_public_api.py b/numpy/tests/test_public_api.py
index b4aa7ec3d..27ff87f49 100644
--- a/numpy/tests/test_public_api.py
+++ b/numpy/tests/test_public_api.py
@@ -94,6 +94,12 @@ def test_import_lazy_import(name):
assert name in dir(np)
+def test_dir_testing():
+ """Assert that output of dir has only one "testing/tester"
+ attribute without duplicate"""
+ assert len(dir(np)) == len(set(dir(np)))
+
+
def test_numpy_linalg():
bad_results = check_dir(np.linalg)
assert bad_results == {}