From a17d88f334dd8a21208bfa22eff9ac31c164e444 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 21 Jul 2019 05:34:02 +0000 Subject: [PATCH] better output formatting git-svn-id: https://xpra.org/svn/Xpra/trunk@23248 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/unittests/unit/net/protocol_test.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/unittests/unit/net/protocol_test.py b/src/unittests/unit/net/protocol_test.py index b341f7ddfb..b2b54267fe 100755 --- a/src/unittests/unit/net/protocol_test.py +++ b/src/unittests/unit/net/protocol_test.py @@ -129,6 +129,7 @@ def test_encoders_and_compressors(self): assert items def test_read_speed(self): + print("\n") total_size = 0 total_elapsed = 0 n_packets = 0 @@ -137,10 +138,10 @@ def test_read_speed(self): total_size += size total_elapsed += elapsed n_packets += n - log.info("\n%-9s incoming packet processing speed:\t%iMB/s", - self.protocol_class.TYPE, total_size/total_elapsed//1024//1024) - log.info("\n%-9s packet parsed per second:\t\t%i", - self.protocol_class.TYPE, n_packets/elapsed) + print("%-9s incoming packet processing speed:\t%iMB/s" % ( + self.protocol_class.TYPE, total_size/total_elapsed//1024//1024)) + print("%-9s packet parsed per second:\t\t%i" % ( + self.protocol_class.TYPE, n_packets/elapsed)) def do_test_read_speed(self, pixel_data_size=2**18, N=100): @@ -199,6 +200,7 @@ def repeat_list(self, items, N=100): return l def test_format_thread(self): + print("\n") packets = self.make_test_packets() N = 1000 many = self.repeat_list(packets, N) @@ -230,9 +232,9 @@ def process_packet_cb(proto, packet): total_size = sum(len(packet) for packet in conn.write_data) elapsed = end-start log("bytes=%s, elapsed=%s", total_size, elapsed) - log.info("\n%-9s format thread:\t\t\t%iMB/s", protocol.TYPE, int(total_size/elapsed//1024//1024)) + print("%-9s format thread:\t\t\t%iMB/s" % (protocol.TYPE, int(total_size/elapsed//1024//1024))) n_packets = len(packets)*N - log.info("\n%-9s packets formatted per second:\t\t%i", protocol.TYPE, int(n_packets/elapsed)) + print("%-9s packets formatted per second:\t\t%i" % (protocol.TYPE, int(n_packets/elapsed))) assert conn.write_data