Remove line number from invocation logs

line numbers are useful for debugging, but the benefit does not
compensate for the painful update of lines in files at each commit
that changes line numbers.
So I have removed those lines only for the test_invocation logs case.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ic1f628d80b204a9a098f3902ebdfd10b480c7613
This commit is contained in:
EstherLerouzic
2023-11-17 11:56:06 +01:00
parent 4ab5bac45f
commit 064d3af8e0
4 changed files with 79 additions and 76 deletions

View File

@@ -2,7 +2,7 @@
from pathlib import Path
import os
from logging import INFO
from logging import INFO, Formatter
import pytest
import subprocess
from gnpy.tools.cli_examples import transmission_main_example, path_requests_run
@@ -34,6 +34,9 @@ def test_example_invocation(capfd, caplog, output, log, handler, args):
"""Make sure that our examples produce useful output"""
os.chdir(SRC_ROOT)
expected = open(SRC_ROOT / 'tests' / 'invocation' / output, mode='r', encoding='utf-8').read()
formatter = Formatter('%(levelname)-9s%(name)s:%(filename)s %(message)s')
caplog.handler.setFormatter(formatter)
# keep INFO level to at least test those logs once
caplog.set_level(INFO)
handler(args)
captured = capfd.readouterr()