Skip to content

Commit

Permalink
#1053: remove unittest2 and mock==1.0.1 deps
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed May 6, 2017
1 parent 7ae9ea8 commit 475211e
Show file tree
Hide file tree
Showing 22 changed files with 21 additions and 34 deletions.
4 changes: 1 addition & 3 deletions .ci/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ if [[ "$(uname -s)" == 'Darwin' ]]; then
pyenv activate psutil
fi

if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]] || [[ $PYVER == 'py26' ]]; then
pip install -U ipaddress unittest2 argparse mock==1.0.1
elif [[ $TRAVIS_PYTHON_VERSION == '2.7' ]] || [[ $PYVER == 'py27' ]]; then
if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]] || [[ $PYVER == 'py27' ]]; then
pip install -U ipaddress mock
elif [[ $TRAVIS_PYTHON_VERSION == '3.2' ]] || [[ $PYVER == 'py32' ]]; then
pip install -U ipaddress mock
Expand Down
2 changes: 1 addition & 1 deletion DEVGUIDE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Makefile
Some useful make commands::

$ make install # install
$ make setup-dev-env # install useful dev libs (pyflakes, unittest2, etc.)
$ make setup-dev-env # install useful dev libs (pyflakes, mock, etc.)
$ make test # run unit tests
$ make test-memleaks # run memory leak tests
$ make coverage # run test coverage
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ DEPS = \
flake8 \
futures \
ipaddress \
mock==1.0.1 \
mock \
pep8 \
perf \
pyflakes \
requests \
setuptools \
sphinx \
twine \
unittest2 \
requests

# In not in a virtualenv, add --user options for install commands.
Expand Down
4 changes: 1 addition & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,11 @@ install:
- "powershell .ci\\appveyor\\install.ps1"
# - ps: (new-object net.webclient).DownloadFile('https://raw.github.com/pypa/pip/master/contrib/get-pip.py', 'C:/get-pip.py')
- "%WITH_COMPILER% %PYTHON%/python.exe -m pip --version"
- "%WITH_COMPILER% %PYTHON%/python.exe -m pip install --upgrade --user unittest2 ipaddress pypiwin32 wmi wheel"
- "%WITH_COMPILER% %PYTHON%/python.exe -m pip freeze"
- "%WITH_COMPILER% %PYTHON%/python.exe setup.py build"
- "%WITH_COMPILER% %PYTHON%/python.exe setup.py build build_ext -i"
- "%WITH_COMPILER% %PYTHON%/python.exe setup.py develop"
# 1.0.1 is the latest release supporting python 2.6
- "%WITH_COMPILER% %PYTHON%/Scripts/pip.exe install mock==1.0.1"
- "%WITH_COMPILER% %PYTHON%/Scripts/pip.exe install mock"

build: off

Expand Down
6 changes: 1 addition & 5 deletions psutil/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import textwrap
import threading
import time
import unittest
import warnings
from socket import AF_INET
from socket import AF_INET6
Expand All @@ -41,11 +42,6 @@
from psutil._compat import unicode
from psutil._compat import which

if sys.version_info < (2, 7):
import unittest2 as unittest # requires "pip install unittest2"
else:
import unittest

try:
from unittest import mock # py3
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
import ssl
import sys
import tempfile
import unittest
try:
from urllib.request import urlopen # py3
except ImportError:
from urllib2 import urlopen

from psutil.tests import unittest
from psutil.tests import VERBOSITY


Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_bsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import os
import re
import time
import unittest

import psutil
from psutil import BSD
Expand All @@ -26,7 +27,6 @@
from psutil.tests import retry_before_failing
from psutil.tests import run_test_module_by_name
from psutil.tests import sh
from psutil.tests import unittest
from psutil.tests import which


Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import socket
import textwrap
import unittest
from contextlib import closing
from socket import AF_INET
from socket import AF_INET6
Expand Down Expand Up @@ -39,7 +40,6 @@
from psutil.tests import skip_on_access_denied
from psutil.tests import tcp_socketpair
from psutil.tests import TESTFN
from psutil.tests import unittest
from psutil.tests import unix_socket_path
from psutil.tests import unix_socketpair
from psutil.tests import wait_for_file
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import stat
import time
import traceback
import unittest
from contextlib import closing

from psutil import BSD
Expand All @@ -38,7 +39,6 @@
from psutil.tests import safe_rmpath
from psutil.tests import skip_on_access_denied
from psutil.tests import TESTFN
from psutil.tests import unittest
from psutil.tests import unix_socket_path
from psutil.tests import VALID_PROC_STATUSES
from psutil.tests import warn
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import tempfile
import textwrap
import time
import unittest
import warnings

import psutil
Expand All @@ -44,7 +45,6 @@
from psutil.tests import TESTFN
from psutil.tests import ThreadTask
from psutil.tests import TRAVIS
from psutil.tests import unittest
from psutil.tests import which


Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_memory_leaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import os
import threading
import time
import unittest

import psutil
import psutil._common
Expand Down Expand Up @@ -46,7 +47,6 @@
from psutil.tests import safe_rmpath
from psutil.tests import TESTFN
from psutil.tests import TRAVIS
from psutil.tests import unittest


LOOPS = 1000
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import socket
import stat
import sys
import unittest

from psutil import LINUX
from psutil import POSIX
Expand Down Expand Up @@ -57,7 +58,6 @@
from psutil.tests import TESTFN
from psutil.tests import TOX
from psutil.tests import TRAVIS
from psutil.tests import unittest
from psutil.tests import unix_socket_path
from psutil.tests import unix_socketpair
from psutil.tests import wait_for_file
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_osx.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import re
import time
import unittest

import psutil
from psutil import OSX
Expand All @@ -18,7 +19,6 @@
from psutil.tests import retry_before_failing
from psutil.tests import run_test_module_by_name
from psutil.tests import sh
from psutil.tests import unittest


PAGESIZE = os.sysconf("SC_PAGE_SIZE") if OSX else None
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import subprocess
import sys
import time
import unittest

import psutil
from psutil import BSD
Expand All @@ -34,7 +35,6 @@
from psutil.tests import sh
from psutil.tests import skip_on_access_denied
from psutil.tests import TRAVIS
from psutil.tests import unittest
from psutil.tests import wait_for_pid


Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import textwrap
import time
import types
import unittest

import psutil

Expand Down Expand Up @@ -65,7 +66,6 @@
from psutil.tests import ThreadTask
from psutil.tests import TOX
from psutil.tests import TRAVIS
from psutil.tests import unittest
from psutil.tests import wait_for_pid
from psutil.tests import WIN_VISTA

Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_sunos.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"""Sun OS specific tests."""

import os
import unittest

import psutil
from psutil import SUNOS
from psutil.tests import run_test_module_by_name
from psutil.tests import sh
from psutil.tests import unittest


@unittest.skipIf(not SUNOS, "SUNOS only")
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import sys
import tempfile
import time
import unittest

import psutil
from psutil import BSD
Expand Down Expand Up @@ -48,7 +49,6 @@
from psutil.tests import TESTFN
from psutil.tests import TESTFN_UNICODE
from psutil.tests import TRAVIS
from psutil.tests import unittest


# ===================================================================
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"""

import os
import unittest
from contextlib import closing

from psutil import BSD
Expand All @@ -79,7 +80,6 @@
from psutil.tests import TESTFN
from psutil.tests import TESTFN_UNICODE
from psutil.tests import TRAVIS
from psutil.tests import unittest
from psutil.tests import unix_socket_path
import psutil
import psutil.tests
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import subprocess
import sys
import time
import unittest

try:
import win32api # requires "pip install pypiwin32" / "make setup-dev-env"
Expand All @@ -37,7 +38,6 @@
from psutil.tests import retry_before_failing
from psutil.tests import run_test_module_by_name
from psutil.tests import sh
from psutil.tests import unittest


cext = psutil._psplatform.cext
Expand Down
1 change: 0 additions & 1 deletion scripts/internal/winmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"pypiwin32",
"pyreadline",
"setuptools",
"unittest2",
"wheel",
"wmi",
"requests"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def main():
packages=packages,
ext_modules=extensions,
test_suite="psutil.tests.get_suite",
tests_require=['ipaddress', 'mock', 'unittest2'],
tests_require=['ipaddress', 'mock'],
zip_safe=False, # http://stackoverflow.com/questions/19548957
# see: python setup.py register --list-classifiers
classifiers=[
Expand Down
5 changes: 1 addition & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
# directory.

[tox]
envlist = py26, py27, py32, py33, py34
envlist = py27, py32, py33, py34, py35, py36

[testenv]
deps =
flake8
py26: ipaddress
py26: mock==1.0.1
py26: unittest2
py27: ipaddress
py27: mock
py32: ipaddress
Expand Down

0 comments on commit 475211e

Please sign in to comment.