Skip to content
Merged
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
29 changes: 29 additions & 0 deletions tests/test_log_leak.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import pytest
import requests

from pytest_httpserver import HTTPServer


class Client:
def __init__(self) -> None:
self.url: str | None = None

def get(self):
if self.url:
requests.get(self.url)


@pytest.fixture()
def my_fixture():
client = Client()
yield client
client.get()


def test_1(my_fixture: Client, httpserver: HTTPServer):
httpserver.expect_request("/foo").respond_with_data("OK")
my_fixture.url = httpserver.url_for("/foo")


def test_2(httpserver: HTTPServer):
assert httpserver.log == []
1 change: 1 addition & 0 deletions tests/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def test_sdist_contents(build: Build, version: str):
"test_hooks.py",
"test_ip_protocols.py",
"test_json_matcher.py",
"test_log_leak.py",
"test_log_querying.py",
"test_mixed.py",
"test_oneshot.py",
Expand Down