Skip to content

Commit

Permalink
Fix flaky test that relies on random order of query
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospri committed Aug 8, 2024
1 parent 33cd94b commit 1979028
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/unit/lms/services/assignment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,13 @@ def test_get_assignments_returns_all_assignments_for_instructor(
)
db_session.flush()

assert db_session.scalars(
svc.get_assignments(instructor_h_userid=instructor_in_assignment.h_userid)
).all() == [assignment, assignment_not_launched_by_instructor]
assert set(
db_session.scalars(
svc.get_assignments(
instructor_h_userid=instructor_in_assignment.h_userid
)
).all()
) == {assignment, assignment_not_launched_by_instructor}

def test_get_assignments_excludes_empty_titles(self, db_session, svc, course):
assignment = factories.Assignment(title=None)
Expand Down

0 comments on commit 1979028

Please sign in to comment.