From 1df5d86046fbe36eb84c3973d2943752958f4693 Mon Sep 17 00:00:00 2001 From: Deepskyhunter Date: Thu, 2 Jun 2022 16:02:30 +0800 Subject: [PATCH 1/2] only check the case when "value" is Dict --- artiq/test/test_scheduler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/artiq/test/test_scheduler.py b/artiq/test/test_scheduler.py index b4327e72e2..107d0d3e14 100644 --- a/artiq/test/test_scheduler.py +++ b/artiq/test/test_scheduler.py @@ -263,7 +263,11 @@ def test_pending_priority(self): expect_idx = 0 def notify(mod): nonlocal expect_idx - self.assertEqual(mod, expect[expect_idx]) + try: + if isinstance(expect[expect_idx]["value"],dict): + self.assertEqual(mod, expect[expect_idx]) + except KeyError: + pass expect_idx += 1 if expect_idx >= len(expect): done.set() From ec60c0e9d5717f9c53f308bb1471c281c63d88af Mon Sep 17 00:00:00 2001 From: Deepskyhunter Date: Thu, 2 Jun 2022 16:56:11 +0800 Subject: [PATCH 2/2] Correct style to flake8 --- artiq/test/test_scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artiq/test/test_scheduler.py b/artiq/test/test_scheduler.py index 107d0d3e14..66903cdf71 100644 --- a/artiq/test/test_scheduler.py +++ b/artiq/test/test_scheduler.py @@ -264,7 +264,7 @@ def test_pending_priority(self): def notify(mod): nonlocal expect_idx try: - if isinstance(expect[expect_idx]["value"],dict): + if isinstance(expect[expect_idx]["value"], dict): self.assertEqual(mod, expect[expect_idx]) except KeyError: pass