summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarrod Millman <jarrod.millman@gmail.com>2021-05-24 14:38:11 -0700
committerGitHub <noreply@github.com>2021-05-24 14:38:11 -0700
commit9c756f19046b880914dff2f0263ee25d146437fa (patch)
tree80d7797f762acd5794b960c51a581c697126a44a
parent2181fb64a718aa9d2bb04d4773a4c30b94ef50fd (diff)
downloadnetworkx-9c756f19046b880914dff2f0263ee25d146437fa.tar.gz
Deprecate run (#4833)
Use pytest directly instead.
-rw-r--r--INSTALL.rst12
-rw-r--r--doc/developer/deprecations.rst1
-rw-r--r--doc/release/release_dev.rst3
-rw-r--r--networkx/testing/test.py10
-rw-r--r--networkx/tests/README21
5 files changed, 13 insertions, 34 deletions
diff --git a/INSTALL.rst b/INSTALL.rst
index de6fae39..62033f1d 100644
--- a/INSTALL.rst
+++ b/INSTALL.rst
@@ -115,15 +115,3 @@ Test an installed package
From a shell command prompt you can test the installed package with::
pytest --pyargs networkx
-
-If you have a file-based (not a Python egg) installation you can test the
-installed package with::
-
- >>> import networkx as nx
- >>> nx.test()
-
-or::
-
- python -c "import networkx as nx; nx.test()"
-
-.. autofunction:: networkx.test
diff --git a/doc/developer/deprecations.rst b/doc/developer/deprecations.rst
index 1b99e81e..5fcc1490 100644
--- a/doc/developer/deprecations.rst
+++ b/doc/developer/deprecations.rst
@@ -86,3 +86,4 @@ Version 3.0
classes defined therein.
* In ``utils/decorators.py`` remove ``preserve_random_state``.
* In ``testing/utils.py`` remove ``almost_equal``.
+* Remove ``testing/test.py``.
diff --git a/doc/release/release_dev.rst b/doc/release/release_dev.rst
index fec41b3b..92df26d6 100644
--- a/doc/release/release_dev.rst
+++ b/doc/release/release_dev.rst
@@ -115,7 +115,8 @@ Deprecations
Deprecate ``preserve_random_state``.
- [`#4827 <https://github.com/networkx/networkx/pull/4827>`_]
Deprecate ``almost_equal``.
-
+- [`#4833 <https://github.com/networkx/networkx/pull/4833>`_]
+ Deprecate ``run``.
Contributors
------------
diff --git a/networkx/testing/test.py b/networkx/testing/test.py
index ce2c636b..9d2fffae 100644
--- a/networkx/testing/test.py
+++ b/networkx/testing/test.py
@@ -1,3 +1,6 @@
+import warnings
+
+
def run(verbosity=1, doctest=False):
"""Run NetworkX tests.
@@ -9,6 +12,13 @@ def run(verbosity=1, doctest=False):
doctest: bool, optional
True to run doctests in code modules
"""
+ warnings.warn(
+ (
+ "`run` is deprecated and will be removed in version 3.0.\n"
+ "Call `pytest` directly from the commandline instead.\n"
+ ),
+ DeprecationWarning,
+ )
import pytest
diff --git a/networkx/tests/README b/networkx/tests/README
deleted file mode 100644
index 965a2cd6..00000000
--- a/networkx/tests/README
+++ /dev/null
@@ -1,21 +0,0 @@
-These files are for testing the methods and functions in NetworkX.
-The pytest testing package is required for all tests:
-https://pytest.org
-
-The tests also demonstrate the usage of many of the features of NetworkX.
-
-There are a few ways to run the tests.
-
-The simplest way is to import networkx and run the test() function.
-
->>> import networkx
->>> networkx.test()
-
-or::
-
- python -c "import networkx; networkx.test()"
-
-If you have the source package and the pytest testing package you
-can test the complete package from the unpacked source directory with::
-
- PYTHONPATH=. pytest networkx