summaryrefslogtreecommitdiff
path: root/networkx/tests/test_import.py
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2021-05-31 07:52:04 -0500
committerGitHub <noreply@github.com>2021-05-31 05:52:04 -0700
commit37aaa2858ce1d06a2a5df3adbbba88bda828bfc5 (patch)
treeee12d0c9522000fb8d7e74ef9be1458ed2a02f1b /networkx/tests/test_import.py
parent7afb9006f3650e0746b41d44863b42fe28a224ab (diff)
downloadnetworkx-37aaa2858ce1d06a2a5df3adbbba88bda828bfc5.tar.gz
Remove "networkx" from top-level networkx namespace (#4840)
* Add a test to catch importing aliases. * Add test for another bad import pattern. * Fix one bad import pattern. Adds __all__ to some modules where it was missing. * use `from ... import` in all __init__ imports Co-authored-by: Dan Schult <dschult@colgate.edu>
Diffstat (limited to 'networkx/tests/test_import.py')
-rw-r--r--networkx/tests/test_import.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/networkx/tests/test_import.py b/networkx/tests/test_import.py
index 6563439b..32aafdf2 100644
--- a/networkx/tests/test_import.py
+++ b/networkx/tests/test_import.py
@@ -4,3 +4,8 @@ import pytest
def test_namespace_alias():
with pytest.raises(ImportError):
from networkx import nx
+
+
+def test_namespace_nesting():
+ with pytest.raises(ImportError):
+ from networkx import networkx