From 90fd8c5d7b60c81b0a7e7169c418b6ee728b4c5c Mon Sep 17 00:00:00 2001 From: anuejn Date: Thu, 22 Oct 2020 23:38:44 +0200 Subject: [PATCH] tests: make spec directory name unique per test method. --- tests/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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( -- 2.30.2