mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Import unittest.mock unconditionally (#2050)
This commit is contained in:
parent
6df58a99b5
commit
b15712924f
@ -4,11 +4,7 @@
|
|||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import unittest.mock as mock
|
||||||
try:
|
|
||||||
import unittest.mock as mock
|
|
||||||
except ImportError:
|
|
||||||
import mock
|
|
||||||
|
|
||||||
import gunicorn.app.base
|
import gunicorn.app.base
|
||||||
import gunicorn.arbiter
|
import gunicorn.arbiter
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
import io
|
import io
|
||||||
import t
|
import t
|
||||||
import pytest
|
import pytest
|
||||||
|
import unittest.mock as mock
|
||||||
|
|
||||||
from gunicorn import util
|
from gunicorn import util
|
||||||
from gunicorn.http.body import Body, LengthReader, EOFReader
|
from gunicorn.http.body import Body, LengthReader, EOFReader
|
||||||
@ -10,11 +11,6 @@ from gunicorn.http.wsgi import Response
|
|||||||
from gunicorn.http.unreader import Unreader, IterUnreader, SocketUnreader
|
from gunicorn.http.unreader import Unreader, IterUnreader, SocketUnreader
|
||||||
from gunicorn.http.errors import InvalidHeader, InvalidHeaderName
|
from gunicorn.http.errors import InvalidHeader, InvalidHeaderName
|
||||||
|
|
||||||
try:
|
|
||||||
import unittest.mock as mock
|
|
||||||
except ImportError:
|
|
||||||
import mock
|
|
||||||
|
|
||||||
|
|
||||||
def assert_readline(payload, size, expected):
|
def assert_readline(payload, size, expected):
|
||||||
body = Body(io.BytesIO(payload))
|
body = Body(io.BytesIO(payload))
|
||||||
|
|||||||
@ -4,11 +4,7 @@
|
|||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
|
import unittest.mock as mock
|
||||||
try:
|
|
||||||
import unittest.mock as mock
|
|
||||||
except ImportError:
|
|
||||||
import mock
|
|
||||||
|
|
||||||
import gunicorn.pidfile
|
import gunicorn.pidfile
|
||||||
|
|
||||||
|
|||||||
@ -3,10 +3,7 @@
|
|||||||
# This file is part of gunicorn released under the MIT license.
|
# This file is part of gunicorn released under the MIT license.
|
||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
try:
|
import unittest.mock as mock
|
||||||
import unittest.mock as mock
|
|
||||||
except ImportError:
|
|
||||||
import mock
|
|
||||||
|
|
||||||
from gunicorn import sock
|
from gunicorn import sock
|
||||||
|
|
||||||
|
|||||||
@ -5,11 +5,7 @@
|
|||||||
|
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
import os
|
import os
|
||||||
|
import unittest.mock as mock
|
||||||
try:
|
|
||||||
import unittest.mock as mock
|
|
||||||
except ImportError:
|
|
||||||
import mock
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user