Skip to content

Commit

Permalink
Fix progress bar tests on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Normandin <[email protected]>
  • Loading branch information
lebrice committed May 17, 2024
1 parent b6c61ca commit 000a169
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions milatools/utils/parallel_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
5 changes: 0 additions & 5 deletions tests/utils/test_parallel_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit 000a169

Please sign in to comment.