From efb5765d740850181798dcec31878d07f6c05ee2 Mon Sep 17 00:00:00 2001 From: "anish.mudaraddi" Date: Thu, 30 Mar 2023 19:23:32 +0100 Subject: [PATCH] small fixes from PR reveiw nitpick fixes --- iriscasttools/iriscasttools/stats.py | 2 +- iriscasttools/test/test_utils.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iriscasttools/iriscasttools/stats.py b/iriscasttools/iriscasttools/stats.py index e9d19410..4a297849 100644 --- a/iriscasttools/iriscasttools/stats.py +++ b/iriscasttools/iriscasttools/stats.py @@ -51,7 +51,7 @@ def parse_args(inp_args): logger.warning("Received invalid command-line arguments %s, ignoring", unknown) # ignore include header if csv arg not set - if args.include_header and not args.as_csv: + if not args.as_csv: args.include_header = False return args diff --git a/iriscasttools/test/test_utils.py b/iriscasttools/test/test_utils.py index dbf3223f..1e93d7e1 100644 --- a/iriscasttools/test/test_utils.py +++ b/iriscasttools/test/test_utils.py @@ -33,10 +33,11 @@ def read_test_from_file(test_fp, expected_out_fp): test_str = txt_file.read() with open(expected_out_fp, "r", encoding="UTF-8") as csv_file: - csv_out = csv.DictReader(csv_file) - for row in csv_out: - expected_out = row - break + reader = csv.reader(csv_file) + headers = next(reader) + row = next(reader) + + expected_out = dict(zip(headers, row)) return test_str, expected_out