From: anuejn Date: Thu, 22 Oct 2020 21:38:44 +0000 (+0200) Subject: tests: make spec directory name unique per test method. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca6fa036f6cd057c997460cf5898bbf791c4546a;p=nmigen.git tests: make spec directory name unique per test method. --- diff --git a/tests/utils.py b/tests/utils.py index 9f2282f..6a50df0 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -28,7 +28,12 @@ class FHDLTestCase(unittest.TestCase): self.assertEqual(prepare_repr(repr(obj)), prepare_repr(repr_str)) def assertFormal(self, spec, mode="bmc", depth=1): - caller, *_ = traceback.extract_stack(limit=2) + stack = traceback.extract_stack() + for frame in reversed(stack): + if os.path.dirname(__file__) not in frame.filename: + break + caller = frame + spec_root, _ = os.path.splitext(caller.filename) spec_dir = os.path.dirname(spec_root) spec_name = "{}_{}".format(