# Path: misc/client.py
# def readline(sock):
# def readexact(sock, size):
#     def __init__(self, sock):
#     def read_status_line(self):
#     def read_headers(self):
#     def encoding(self):
#     def read_body(self):
#     def json(self):
#     def __init__(self, addr):
#     def maybe_connect(self):
#     def putline(self, line=None):
#     def putclose(self, data):
#     def putrequest(self, method, path, query_string=None):
#     def request(self, method, path, query_string=None, headers=None,
#                 body=None):
#     def putheader(self, name, value):
#     def endheaders(self, body=None):
#     def getresponse(self):
#     def close(self):
# def chunked_encoder(data):
# class Response:
# class Connection:


import pytest
import integration_tests.common
from misc import client



pytestmark = pytest.mark.needs_build(
    '--extra-compile=-DPROTOCOL_TRACK_REFCNT=1', dest='.test/noleak')


@pytest.fixture(scope='function')
def server(request):
    arg = request.node.get_marker('arg').args[0]

    server = integration_tests.common.start_server([
        'integration_tests/noleak.py', arg], path='.test/noleak')

    yield server

    server.terminate()
    server.wait() == 0


@pytest.fixture(scope='function')
def connection(server):

# Path: misc/client.py
# def readline(sock):
# def readexact(sock, size):
#     def __init__(self, sock):
#     def read_status_line(self):
#     def read_headers(self):
#     def encoding(self):
#     def read_body(self):
#     def json(self):
#     def __init__(self, addr):
#     def maybe_connect(self):
#     def putline(self, line=None):
#     def putclose(self, data):
#     def putrequest(self, method, path, query_string=None):
#     def request(self, method, path, query_string=None, headers=None,
#                 body=None):
#     def putheader(self, name, value):
#     def endheaders(self, body=None):
#     def getresponse(self):
#     def close(self):
# def chunked_encoder(data):
# class Response:
# class Connection:


# Path: integration_tests/test_noleak.py
import pytest
import integration_tests.common
from misc import client




pytestmark = pytest.mark.needs_build(
    '--extra-compile=-DPROTOCOL_TRACK_REFCNT=1', dest='.test/noleak')


@pytest.fixture(scope='function')
def server(request):
    arg = request.node.get_marker('arg').args[0]

    server = integration_tests.common.start_server([
        'integration_tests/noleak.py', arg], path='.test/noleak')

    yield server

    server.terminate()
    server.wait() == 0


@pytest.fixture(scope='function')
def connection(server):

    conn = client.Connection('localhost:8080')