summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.appveyor.yml7
-rw-r--r--requirements/test.txt4
-rw-r--r--setup.cfg16
-rw-r--r--setup.py6
-rwxr-xr-xtools/travis/script.sh5
5 files changed, 10 insertions, 28 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index bbc58da6..3a4e9cd4 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -44,12 +44,13 @@ install:
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
+ # install required packages
+ - "pip install -r requirements.txt"
+
# Install the build and runtime dependencies of the project.
# - "%CMD_IN_ENV% pip install --timeout=60 -r requirements.txt"
- "pip install ."
- - "pip install nose"
-
# Not a .NET project, we build networkx in the install step instead
build: false
@@ -57,4 +58,4 @@ test_script:
# Change to a non-source folder to make sure we run the tests on the
# installed library.
- "pushd %TEMP%"
- - "nosetests --verbosity=2 networkx"
+ - "pytest --pyargs networkx"
diff --git a/requirements/test.txt b/requirements/test.txt
index 72044bae..8e252103 100644
--- a/requirements/test.txt
+++ b/requirements/test.txt
@@ -1,4 +1,4 @@
nose>=1.3.7
-nose-ignore-docstring>=0.2
-coverage>=4.5.2
+pytest>=5.2.1
+pytest-cov>=2.8.1
codecov>=2.0.15
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index ab23e560..00000000
--- a/setup.cfg
+++ /dev/null
@@ -1,16 +0,0 @@
-[nosetests]
-verbosity=0
-detailed-errors=1
-with-doctest=0
-
-# The default regex which discovers test modules catches networkx.testing
-# and declares it as a test module, even though it is not a test module
-# This causes a very small discrepancy between the coverage report as
-# generated by nosetests, and the coverage report as generated by coverage.
-# If we want them to agree, then we need to make sure that networkx.testing
-# is not captured by the default match regex.
-#
-# Default is: (?:^|[\b_\./-])[Tt]est
-#
-match=(?:^|[\b_\./-])[Tt]est(?!ing)
-
diff --git a/setup.py b/setup.py
index 01eac1be..03bfd53a 100644
--- a/setup.py
+++ b/setup.py
@@ -124,11 +124,11 @@ package_data = {
install_requires = ['decorator>=4.3.0']
extras_require = {'all': ['numpy', 'scipy', 'pandas', 'matplotlib',
'pygraphviz', 'pydot', 'pyyaml', 'gdal', 'lxml',
- 'nose'],
+ 'pytest'],
'gdal': ['gdal'],
'lxml': ['lxml'],
'matplotlib': ['matplotlib'],
- 'nose': ['nose'],
+ 'pytest': ['pytest'],
'numpy': ['numpy'],
'pandas': ['pandas'],
'pydot': ['pydot'],
@@ -163,7 +163,5 @@ if __name__ == "__main__":
install_requires=install_requires,
extras_require=extras_require,
python_requires='>=3.5',
- test_suite='nose.collector',
- tests_require=['nose>=1.3.7'],
zip_safe=False
)
diff --git a/tools/travis/script.sh b/tools/travis/script.sh
index 108ffe89..bee0c2fe 100755
--- a/tools/travis/script.sh
+++ b/tools/travis/script.sh
@@ -11,7 +11,6 @@ export NX_INSTALL=$(pip show networkx | grep Location | awk '{print $2"/networkx
# package (except during the report). So to restrict coverage, we must
# inform coverage through the .coveragerc file.
cp .coveragerc $NX_INSTALL
-cp setup.cfg $NX_INSTALL
# Move to new directory so that networkx is not imported from repository.
# Why? Because we want the tests to make sure that NetworkX was installed
@@ -24,10 +23,10 @@ printenv PWD
# Run nosetests.
if [[ "${REPORT_COVERAGE}" == 1 ]]; then
- nosetests --verbosity=2 --with-ignore-docstrings --with-coverage --cover-package=networkx
+ pytest --cov=networkx --pyargs networkx
cp -a .coverage $NX_SOURCE
else
- nosetests --verbosity=2 --with-ignore-docstrings
+ pytest --pyargs networkx
fi
cd $NX_SOURCE