From 62af5596c7d85b8662dddbaddd8a08bbe1f6d69f Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 22 Sep 2015 15:11:21 -0400 Subject: [PATCH] Core no longer depends on the standalone `mock` module. (Closes: #146) --- setup.py | 1 - src/mailman/bin/tests/test_mailman.py | 2 +- src/mailman/commands/tests/test_conf.py | 2 +- src/mailman/commands/tests/test_import.py | 2 +- src/mailman/config/tests/test_configuration.py | 2 +- src/mailman/database/tests/test_factory.py | 2 +- src/mailman/docs/NEWS.rst | 1 + src/mailman/runners/tests/test_nntp.py | 2 +- src/mailman/testing/helpers.py | 2 +- src/mailman/utilities/tests/test_import.py | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index e2d323adb..99f0ce743 100644 --- a/setup.py +++ b/setup.py @@ -99,7 +99,6 @@ case second `m'. Any other spelling is incorrect.""", 'httplib2', 'lazr.config', 'lazr.smtptest', - 'mock', 'nose2', 'passlib', 'sqlalchemy', diff --git a/src/mailman/bin/tests/test_mailman.py b/src/mailman/bin/tests/test_mailman.py index 8c5a3396b..38c684425 100644 --- a/src/mailman/bin/tests/test_mailman.py +++ b/src/mailman/bin/tests/test_mailman.py @@ -25,8 +25,8 @@ __all__ = [ import unittest from io import StringIO -from mock import patch from mailman.bin.mailman import main +from unittest.mock import patch diff --git a/src/mailman/commands/tests/test_conf.py b/src/mailman/commands/tests/test_conf.py index 5ff93895d..7412b5dec 100644 --- a/src/mailman/commands/tests/test_conf.py +++ b/src/mailman/commands/tests/test_conf.py @@ -24,13 +24,13 @@ __all__ = [ import os import sys -import mock import tempfile import unittest from io import StringIO from mailman.commands.cli_conf import Conf from mailman.testing.layers import ConfigLayer +from unittest import mock diff --git a/src/mailman/commands/tests/test_import.py b/src/mailman/commands/tests/test_import.py index 96f955e52..9da0dac5b 100644 --- a/src/mailman/commands/tests/test_import.py +++ b/src/mailman/commands/tests/test_import.py @@ -27,8 +27,8 @@ import unittest from mailman.app.lifecycle import create_list from mailman.commands.cli_import import Import21 from mailman.testing.layers import ConfigLayer -from mock import patch from pkg_resources import resource_filename +from unittest.mock import patch diff --git a/src/mailman/config/tests/test_configuration.py b/src/mailman/config/tests/test_configuration.py index 5a245c8b7..b45767cb7 100644 --- a/src/mailman/config/tests/test_configuration.py +++ b/src/mailman/config/tests/test_configuration.py @@ -25,7 +25,6 @@ __all__ = [ import os -import mock import tempfile import unittest @@ -37,6 +36,7 @@ from mailman.interfaces.configuration import ( from mailman.testing.helpers import configuration, event_subscribers from mailman.testing.layers import ConfigLayer from pkg_resources import resource_filename +from unittest import mock diff --git a/src/mailman/database/tests/test_factory.py b/src/mailman/database/tests/test_factory.py index acb7c32a4..b0133c5ef 100644 --- a/src/mailman/database/tests/test_factory.py +++ b/src/mailman/database/tests/test_factory.py @@ -31,10 +31,10 @@ from mailman.database.factory import LAST_STORM_SCHEMA_VERSION, SchemaManager from mailman.database.model import Model from mailman.interfaces.database import DatabaseError from mailman.testing.layers import ConfigLayer -from mock import patch from sqlalchemy import MetaData, Table, Column, Integer, Unicode from sqlalchemy.exc import ProgrammingError, OperationalError from sqlalchemy.schema import Index +from unittest.mock import patch diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst index 655b9c189..16d59081e 100644 --- a/src/mailman/docs/NEWS.rst +++ b/src/mailman/docs/NEWS.rst @@ -43,6 +43,7 @@ Bugs backported smtpd module which can accept non-UTF-8 data. (Closes #140) * Bulk emails are now decorated with headers and footers. Given by Aurélien Bompard. (Closes #145) + * Core no longer depends on the standalone `mock` module. (Closes: #146) 3.0.0 -- "Show Don't Tell" diff --git a/src/mailman/runners/tests/test_nntp.py b/src/mailman/runners/tests/test_nntp.py index 6f3994c75..bfa87e942 100644 --- a/src/mailman/runners/tests/test_nntp.py +++ b/src/mailman/runners/tests/test_nntp.py @@ -23,7 +23,6 @@ __all__ = [ ] -import mock import socket import nntplib import unittest @@ -36,6 +35,7 @@ from mailman.testing.helpers import ( LogFileMark, configuration, get_queue_messages, make_testable_runner, specialized_message_from_string as mfs) from mailman.testing.layers import ConfigLayer +from unittest import mock diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py index 8fa4fbd2f..b05847b42 100644 --- a/src/mailman/testing/helpers.py +++ b/src/mailman/testing/helpers.py @@ -40,7 +40,6 @@ __all__ = [ import os import json -import mock import time import uuid import errno @@ -67,6 +66,7 @@ from mailman.interfaces.styles import IStyleManager from mailman.interfaces.usermanager import IUserManager from mailman.runners.digest import DigestRunner from mailman.utilities.mailbox import Mailbox +from unittest import mock from urllib.error import HTTPError from urllib.parse import urlencode from zope import event diff --git a/src/mailman/utilities/tests/test_import.py b/src/mailman/utilities/tests/test_import.py index 9f3d59d5a..214e56889 100644 --- a/src/mailman/utilities/tests/test_import.py +++ b/src/mailman/utilities/tests/test_import.py @@ -29,7 +29,6 @@ __all__ = [ import os -import mock import unittest from datetime import timedelta, datetime @@ -56,6 +55,7 @@ from mailman.utilities.importer import import_config_pck, Import21Error from mailman.utilities.string import expand from pickle import load from pkg_resources import resource_filename +from unittest import mock from zope.component import getUtility -- 2.11.4.GIT