Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove python2 cruft & ancient mock #481

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ httplib2>=0.17.0
httpx>=0.18.1
ipdb>=0.13.2
mccabe>=0.6.1
mock>=3.0.5;python_version<"3.3"
ndg-httpsclient>=0.5.1
nose-randomly>=1.2.6
nose>=1.3.7
Expand Down
1 change: 0 additions & 1 deletion httpretty/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from __future__ import unicode_literals
import json

class HTTPrettyError(Exception):
Expand Down
2 changes: 0 additions & 2 deletions httpretty/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from __future__ import unicode_literals

import re
from .compat import BaseClass
from .utils import decode_utf8
Expand Down
1 change: 0 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sure
4 changes: 0 additions & 4 deletions tests/compat.py

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

from __future__ import unicode_literals

import os
import json
import socket
Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_bypass.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from __future__ import unicode_literals
import time
import requests
try:
Expand Down
3 changes: 1 addition & 2 deletions tests/functional/test_fakesocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@

import functools
import socket

import mock
from unittest import mock


class FakeSocket(socket.socket):
Expand Down
3 changes: 1 addition & 2 deletions tests/functional/test_httplib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from __future__ import unicode_literals

import re

import httplib2
from freezegun import freeze_time
from sure import expect, within, miliseconds
Expand Down
3 changes: 1 addition & 2 deletions tests/functional/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import requests
import signal
import httpretty
from unittest.mock import Mock

from freezegun import freeze_time
from contextlib import contextmanager
Expand All @@ -38,8 +39,6 @@

from tests.functional.base import FIXTURE_FILE, use_tornado_server

from tests.compat import Mock


try:
advance_iterator = next
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/test_urllib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from __future__ import unicode_literals

import re
try:
from urllib.request import urlopen
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/testserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from __future__ import unicode_literals

import os
import time
import socket
Expand Down
2 changes: 0 additions & 2 deletions tests/pyopenssl/test_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from __future__ import unicode_literals

import requests

from httpretty import HTTPretty, httprettified
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_core.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import io
import json
import errno
from unittest.mock import Mock, patch, call

from freezegun import freeze_time
from sure import expect

from httpretty.core import HTTPrettyRequest, FakeSSLSocket, fakesock, httpretty
from httpretty.core import URIMatcher, URIInfo

from tests.compat import Mock, patch, call


class SocketErrorStub(Exception):
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_http.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from httpretty.http import parse_requestline


Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_httpretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from __future__ import unicode_literals
import re
import json
from unittest.mock import MagicMock, patch

from sure import expect

import httpretty
from httpretty import HTTPretty
from httpretty import HTTPrettyError
from httpretty import core
from httpretty.core import URIInfo, BaseClass, Entry, FakeSockFile, HTTPrettyRequest
from httpretty.http import STATUSES

from tests.compat import MagicMock, patch


TEST_HEADER = """
GET /test/test.html HTTP/1.1
Expand Down
8 changes: 2 additions & 6 deletions tests/unit/test_main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest.mock import patch

import httpretty
from httpretty.core import HTTPrettyRequest

try:
from unittest.mock import patch
except ImportError:
from mock import patch


@patch('httpretty.httpretty')
def test_last_request(original):
Expand Down