mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-02 02:57:52 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user