Skip to content

Fix asyncio locks test case #93247

Description

@cykerway

There are some clear minor mistakes in asyncio locks test case: Duplicate statements and wrong assert function.

The duplicate statements (L846 and L850) might be intentional but the assert function (L856) is obviously wrong.

await asyncio.sleep(0)
self.assertEqual(0, sem._value)
self.assertEqual(3, len(result))
self.assertTrue(sem.locked())
self.assertEqual(1, len(sem._waiters))
self.assertEqual(0, sem._value)
self.assertTrue(t1.done())
self.assertTrue(t1.result())
race_tasks = [t2, t3, t4]
done_tasks = [t for t in race_tasks if t.done() and t.result()]
self.assertTrue(2, len(done_tasks))

Activity

  1. added a commit that references this issue on Jun 6, 2022
  2. added 4 commits that reference this issue on Jun 6, 2022
  3. kumaraditya303 commented on Jun 14, 2022

    @kumaraditya303
    Contributor

    Fixed by #93248

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions