Improve test added in 29fee01f to not leak warnings.
authorwhitequark <whitequark@whitequark.org>
Sat, 3 Aug 2019 13:44:44 +0000 (13:44 +0000)
committerwhitequark <whitequark@whitequark.org>
Sat, 3 Aug 2019 13:44:44 +0000 (13:44 +0000)
nmigen/test/test_hdl_ir.py

index 2ad5eb24579a38f74c4a5ef9c559e333ad4b8714..439b791c9819f5a44c61c7115daf3ebb1332dd8d 100644 (file)
@@ -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):