From d5f83c9dcb41d8575b82bc609d78614ba488c556 Mon Sep 17 00:00:00 2001 From: CodyCBakerPhD Date: Wed, 4 Sep 2024 17:08:58 -0400 Subject: [PATCH] fix windows --- tests/streaming_cli_tests.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/streaming_cli_tests.py b/tests/streaming_cli_tests.py index ac447bbbe..8348af04a 100644 --- a/tests/streaming_cli_tests.py +++ b/tests/streaming_cli_tests.py @@ -73,7 +73,11 @@ def test_dandiset_streaming_cli_saved_report(tmpdir: py.path.local): with open(file=expected_report_file_path, mode="r") as io: expected_report = io.readlines() - assert test_report[14:-1] == expected_report[14:] + # Different platforms maybe have different indices for start and end of test reports + report_start = test_report.index(f"0 CRITICAL{os.linesep}") + expected_report_length = 38 + report_end = report_start + expected_report_length + assert test_report[report_start:report_end] == expected_report[14:] @pytest.mark.skipif(not STREAMING_TESTS_ENABLED, reason=DISABLED_STREAMING_TESTS_REASON or "") @@ -102,4 +106,8 @@ def test_dandiset_streaming_cli_with_version_saved_report(tmpdir: py.path.local) with open(file=expected_report_file_path, mode="r") as io: expected_report = io.readlines() - assert test_report[14:-1] == expected_report[14:] + # Different platforms maybe have different indices for start and end of test reports + report_start = test_report.index(f"0 CRITICAL{os.linesep}") + expected_report_length = 38 + report_end = report_start + expected_report_length + assert test_report[report_start:report_end] == expected_report[14:]