Skip to content

Commit

Permalink
Rely on backports.unittest_mock (and its pytest plugin) to supply mock.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 26, 2016
1 parent 6e7e208 commit 6da8b85
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
5 changes: 0 additions & 5 deletions cherrypy/test/helper.py
Expand Up @@ -11,11 +11,6 @@
import unittest
import warnings

try:
from unittest import mock
except ImportError:
import mock

import nose
import six

Expand Down
2 changes: 1 addition & 1 deletion cherrypy/test/test_encoding.py
Expand Up @@ -2,14 +2,14 @@

import gzip
import io
from unittest import mock

import six

import cherrypy
from cherrypy._cpcompat import IncompleteRead, ntob, ntou

from cherrypy.test import helper
from cherrypy.test.helper import mock


europoundUnicode = ntou('£', encoding='utf-8')
Expand Down
2 changes: 1 addition & 1 deletion cherrypy/test/test_http.py
Expand Up @@ -4,14 +4,14 @@
import mimetypes
import socket
import sys
from unittest import mock

import six

import cherrypy
from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob

from cherrypy.test import helper
from cherrypy.test.helper import mock


def encode_multipart_formdata(files):
Expand Down
4 changes: 2 additions & 2 deletions cherrypy/wsgiserver/test_wsgiserver.py
@@ -1,9 +1,9 @@
from unittest import mock

import six

from cherrypy import wsgiserver

from cherrypy.test.helper import mock


class TestWSGIGateway_u0:
@mock.patch('cherrypy.wsgiserver.WSGIGateway_10.get_environ',
Expand Down
6 changes: 1 addition & 5 deletions setup.py
Expand Up @@ -110,6 +110,7 @@
'nose-testconfig', # only used in cherrypy.test.helper
'objgraph', # cherrypy.lib.gctools
'pytest',
'backports.unittest_mock',
],
# Enables memcached session support via `cherrypy[memcached_session]`:
'memcached_session': ['python-memcached>=1.58'],
Expand All @@ -121,11 +122,6 @@
}
"""Feature flags end-users can use in dependencies"""

if sys.version_info < (3, 3):
extras_require['testing'].append(
'mock' # accessed through cherrypy.test.helper.mock
)

###############################################################################
# end arguments for setup
###############################################################################
Expand Down

0 comments on commit 6da8b85

Please sign in to comment.