From 000a1698c2dd1d949c501030bca7dd209e508ec2 Mon Sep 17 00:00:00 2001 From: Fabrice Normandin Date: Fri, 17 May 2024 15:19:33 -0400 Subject: [PATCH] Fix progress bar tests on Windows Signed-off-by: Fabrice Normandin --- milatools/utils/parallel_progress.py | 3 +++ tests/utils/test_parallel_progress.py | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/milatools/utils/parallel_progress.py b/milatools/utils/parallel_progress.py index d0e204e1..8edcfa2a 100644 --- a/milatools/utils/parallel_progress.py +++ b/milatools/utils/parallel_progress.py @@ -83,6 +83,9 @@ async def run_async_tasks_with_progress_bar( NOTE: This differs from the usual progress bar: the results are returned as a list (all at the same time) instead of one at a time. + >>> import pytest, sys + >>> if sys.platform.startswith('win'): + ... pytest.skip('This doctest doesn't work properly on Windows.') >>> async def example_task_fn(report_progress: ReportProgressFn, len_of_task: int): ... import random ... report_progress(progress=0, total=len_of_task, info="Starting.") diff --git a/tests/utils/test_parallel_progress.py b/tests/utils/test_parallel_progress.py index cc2b282c..1ccd902b 100644 --- a/tests/utils/test_parallel_progress.py +++ b/tests/utils/test_parallel_progress.py @@ -84,11 +84,6 @@ async def test_async_progress_bar(file_regression: FileRegressionFixture): assert total_time_seconds < 2 * task_length -@xfails_on_windows( - raises=AssertionError, - reason="Output is weird on windows? something to do with linebreaks perhaps.", - strict=True, -) @pytest.mark.asyncio async def test_interrupt_progress_bar(): """Test the case where one of the tasks raises an exception."""