From: whitequark Date: Sat, 3 Aug 2019 13:44:44 +0000 (+0000) Subject: Improve test added in 29fee01f to not leak warnings. X-Git-Tag: locally_working~64 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ab5426ce748ac2ddcc0202ca757383cb829b15e4;p=nmigen.git Improve test added in 29fee01f to not leak warnings. --- 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):