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

Fix functional tests compatibility with pytest #453

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
8 changes: 4 additions & 4 deletions tests/functional/test_bypass.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def stop_tcp_server(context):

@httpretty.activate
@that_with_context(start_http_server, stop_http_server)
def test_httpretty_bypasses_when_disabled(context):
def test_httpretty_bypasses_when_disabled(context=None):
"httpretty should bypass all requests by disabling it"

httpretty.register_uri(
Expand Down Expand Up @@ -122,7 +122,7 @@ def test_httpretty_bypasses_when_disabled(context):

@httpretty.activate(verbose=True)
@that_with_context(start_http_server, stop_http_server)
def test_httpretty_bypasses_a_unregistered_request(context):
def test_httpretty_bypasses_a_unregistered_request(context=None):
"httpretty should bypass a unregistered request by disabling it"

httpretty.register_uri(
Expand All @@ -145,7 +145,7 @@ def test_httpretty_bypasses_a_unregistered_request(context):

@httpretty.activate(verbose=True)
@that_with_context(start_tcp_server, stop_tcp_server)
def test_using_httpretty_with_other_tcp_protocols(context):
def test_using_httpretty_with_other_tcp_protocols(context=None):
"httpretty should work even when testing code that also use other TCP-based protocols"

httpretty.register_uri(
Expand All @@ -163,7 +163,7 @@ def test_using_httpretty_with_other_tcp_protocols(context):

@httpretty.activate(allow_net_connect=False)
@that_with_context(start_http_server, stop_http_server)
def test_disallow_net_connect_1(context, verbose=True):
def test_disallow_net_connect_1(context=None, verbose=True):
"""
When allow_net_connect = False, a request that otherwise
would have worked results in UnmockedError.
Expand Down
10 changes: 5 additions & 5 deletions tests/functional/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def create_socket(context):
@skip('not currently supported')
@httprettified
@scenario(create_socket)
def test_httpretty_debugs_socket_send(context):
def test_httpretty_debugs_socket_send(context=None):
"HTTPretty should forward_and_trace socket.send"

expect(context.sock.send).when.called_with(b'data').to.throw(
Expand All @@ -50,7 +50,7 @@ def test_httpretty_debugs_socket_send(context):
@skip('not currently supported')
@httprettified
@scenario(create_socket)
def test_httpretty_debugs_socket_sendto(context):
def test_httpretty_debugs_socket_sendto(context=None):
"HTTPretty should forward_and_trace socket.sendto"

expect(context.sock.sendto).when.called.to.throw(
Expand All @@ -61,7 +61,7 @@ def test_httpretty_debugs_socket_sendto(context):
@skip('not currently supported')
@httprettified
@scenario(create_socket)
def test_httpretty_debugs_socket_recvfrom(context):
def test_httpretty_debugs_socket_recvfrom(context=None):
"HTTPretty should forward_and_trace socket.recvfrom"

expect(context.sock.recvfrom).when.called.to.throw(
Expand All @@ -72,7 +72,7 @@ def test_httpretty_debugs_socket_recvfrom(context):
@skip('not currently supported')
@httprettified
@scenario(create_socket)
def test_httpretty_debugs_socket_recv_into(context):
def test_httpretty_debugs_socket_recv_into(context=None):
"HTTPretty should forward_and_trace socket.recv_into"
buf = bytearray()
expect(context.sock.recv_into).when.called_with(buf).to.throw(
Expand All @@ -83,7 +83,7 @@ def test_httpretty_debugs_socket_recv_into(context):
@skip('not currently supported')
@httprettified
@scenario(create_socket)
def test_httpretty_debugs_socket_recvfrom_into(context):
def test_httpretty_debugs_socket_recvfrom_into(context=None):
"HTTPretty should forward_and_trace socket.recvfrom_into"

expect(context.sock.recvfrom_into).when.called.to.throw(
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def test_unicode_querystrings():


@use_tornado_server
def test_recording_calls(port):
def test_recording_calls(port=None):
("HTTPretty should be able to record calls")
# Given a destination path:
destination = FIXTURE_FILE("recording-1.json")
Expand Down