Skip to content

Commit

Permalink
fix: intermittent/flaky test assertion failure in test_sync_courserun…
Browse files Browse the repository at this point in the history
…s_data (#2983)
  • Loading branch information
mudassir-hafeez committed May 21, 2024
1 parent 13102aa commit 7023882
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion courses/tasks_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Tests for Course related tasks"""

from collections import Counter

import pytest

from courses.factories import CourseRunFactory
Expand All @@ -16,4 +18,8 @@ def test_sync_courseruns_data(mocker):
CourseRunFactory.create_batch(size=3, course__is_external=True)

sync_courseruns_data.delay()
sync_course_runs.assert_called_once_with(course_runs)
sync_course_runs.assert_called_once()

called_args, _ = sync_course_runs.call_args
actual_course_runs = called_args[0]
assert Counter(actual_course_runs) == Counter(course_runs)

0 comments on commit 7023882

Please sign in to comment.