From: Robert Jordens Date: Sat, 30 Nov 2013 13:51:24 +0000 (-0700) Subject: migen/test: if SimCase is a TestCase, it's run in every module that imports it X-Git-Tag: 24jan2021_ls180~2099^2~413 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e54fa6f5f4b7f087a10438bbc9402d0c2018d170;p=litex.git migen/test: if SimCase is a TestCase, it's run in every module that imports it --- diff --git a/migen/test/support.py b/migen/test/support.py index 913462ac..e99cfb2c 100644 --- a/migen/test/support.py +++ b/migen/test/support.py @@ -9,7 +9,7 @@ class SimBench(Module): if self.callback is not None: return self.callback(self, s) -class SimCase(unittest.TestCase): +class SimCase: TestBench = SimBench def setUp(self, *args, **kwargs): diff --git a/migen/test/test_coding.py b/migen/test/test_coding.py index de098050..2d0f53d9 100644 --- a/migen/test/test_coding.py +++ b/migen/test/test_coding.py @@ -5,7 +5,7 @@ from migen.genlib.coding import * from migen.test.support import SimCase, SimBench -class EncCase(SimCase): +class EncCase(SimCase, unittest.TestCase): class TestBench(SimBench): def __init__(self): self.submodules.dut = Encoder(8) @@ -29,7 +29,7 @@ class EncCase(SimCase): self.assertEqual(i, 1<