Simplify logs2. (#3045)

* Simplify logs2.

* Changing the scope from module to session to fix the event_loop issue.
This commit is contained in:
Nicolas Patry 2025-02-21 10:03:40 +01:00 committed by GitHub
parent 06dfe9abfe
commit 142a49a80d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,6 +81,8 @@ def container_log(request: SubRequest):
if request.session.testsfailed:
error_log.seek(0)
print(error_log.read(), file=sys.stderr)
else:
error_log.truncate(0)
class ResponseComparator(JSONSnapshotExtension):
@ -350,13 +352,13 @@ def ignore_logprob_response_snapshot(snapshot):
return snapshot.use_extension(IgnoreLogProbResponseComparator)
@pytest.fixture(scope="module")
@pytest.fixture(scope="session")
def error_log():
with tempfile.TemporaryFile("w+") as tmp:
yield tmp
@pytest.fixture(scope="module")
@pytest.fixture(scope="session")
async def launcher(error_log):
@contextlib.contextmanager
def local_launcher(