From f2c93a626e84ea5255a820a09aa2a9b619ccc58e Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 3 Aug 2019 13:44:44 +0000 Subject: [PATCH] Improve test added in 29fee01f to not leak warnings. --- nmigen/test/test_hdl_ir.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nmigen/test/test_hdl_ir.py b/nmigen/test/test_hdl_ir.py index 2ad5eb2..439b791 100644 --- a/nmigen/test/test_hdl_ir.py +++ b/nmigen/test/test_hdl_ir.py @@ -18,9 +18,11 @@ class FragmentGetTestCase(FHDLTestCase): msg="Object 'None' cannot be elaborated"): Fragment.get(None, platform=None) - with self.assertRaises(AttributeError, - msg="Object 'None' cannot be elaborated"): - Fragment.get(BadElaboratable(), platform=None) + with self.assertWarns(UserWarning, + msg=".elaborate() returned None; missing return statement?"): + with self.assertRaises(AttributeError, + msg="Object 'None' cannot be elaborated"): + Fragment.get(BadElaboratable(), platform=None) class FragmentGeneratedTestCase(FHDLTestCase): -- 2.30.2