Skip to content

Commit

Permalink
Merge pull request #392 from jelly/unittest-mock
Browse files Browse the repository at this point in the history
test: mock is now a build in Python module
  • Loading branch information
meejah authored Nov 8, 2023
2 parents 668d829 + ffcc20d commit 02ae60a
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 18 deletions.
1 change: 0 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ wheel
twine
pyflakes
pycodestyle
mock
ipaddress>=1.0.16
geoip
readme_renderer
1 change: 0 additions & 1 deletion doc-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ wheel
twine
pyflakes
pycodestyle
mock
ipaddress>=1.0.16
geoip
readme_renderer
2 changes: 1 addition & 1 deletion test/py3_test_controller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mock import Mock
from unittest.mock import Mock

from twisted.trial import unittest
from twisted.internet.defer import ensureDeferred
Expand Down
2 changes: 1 addition & 1 deletion test/test_attacher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mock import Mock
from unittest.mock import Mock
from zope.interface import directlyProvides

from twisted.trial import unittest
Expand Down
4 changes: 2 additions & 2 deletions test/test_circuit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime
import ipaddress
from mock import patch
from unittest.mock import patch

from twisted.trial import unittest
from twisted.internet import defer
Expand All @@ -21,7 +21,7 @@
from txtorcon.interface import CircuitListenerMixin
from txtorcon.interface import ITorControlProtocol

from mock import Mock
from unittest.mock import Mock


@implementer(IRouterContainer)
Expand Down
2 changes: 1 addition & 1 deletion test/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import six
import functools
from os.path import join
from mock import Mock, patch
from unittest.mock import Mock, patch
from io import BytesIO

from twisted.internet.interfaces import IReactorCore
Expand Down
4 changes: 2 additions & 2 deletions test/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import os
import sys
from mock import patch
from mock import Mock, MagicMock
from unittest.mock import patch
from unittest.mock import Mock, MagicMock
from unittest import skipIf
from binascii import b2a_base64

Expand Down
2 changes: 1 addition & 1 deletion test/test_onion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os
import sys
from mock import Mock
from unittest.mock import Mock
from os.path import join
from unittest import skipIf

Expand Down
2 changes: 1 addition & 1 deletion test/test_router.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from datetime import datetime
from mock import Mock
from unittest.mock import Mock

from twisted.trial import unittest
from twisted.internet import defer
Expand Down
2 changes: 1 addition & 1 deletion test/test_socks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from six import BytesIO, text_type
from mock import Mock, patch
from unittest.mock import Mock, patch

from twisted.trial import unittest
from twisted.internet import defer
Expand Down
2 changes: 1 addition & 1 deletion test/test_torconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import functools
import warnings
from six import StringIO
from mock import Mock, patch
from unittest.mock import Mock, patch
from os.path import join

from zope.interface import implementer, directlyProvides
Expand Down
2 changes: 1 addition & 1 deletion test/test_torstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from ipaddress import IPv4Address

from mock import patch, Mock
from unittest.mock import patch, Mock

from txtorcon import TorControlProtocol
from txtorcon import TorProtocolError
Expand Down
2 changes: 1 addition & 1 deletion test/test_util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import tempfile
import ipaddress
from mock import patch
from unittest.mock import patch
from unittest import skip as _skip
from os.path import exists

Expand Down
2 changes: 1 addition & 1 deletion test/test_web.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from mock import Mock
from unittest.mock import Mock

from twisted.web.client import BrowserLikePolicyForHTTPS
from twisted.trial import unittest
Expand Down
2 changes: 1 addition & 1 deletion test3/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import six
import unittest
from mock import Mock, patch
from unittest.mock import Mock, patch

from zope.interface import directlyProvides

Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ deps=
zope.interface>=3.6.1
setuptools>=0.8.0
automat
mock
## XXX this doesn't work on github-actions
## GeoIP
coverage
Expand Down

0 comments on commit 02ae60a

Please sign in to comment.