From ec9a02f5c1a8d66461df0a80060d9777a287d794 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Mon, 19 Aug 2019 17:12:28 +0200 Subject: [PATCH] fix: test_params randomly failes test_params checks for equality of repr(p), with p a Parameter the old code skips the first 12 characters, which covers most cases, but not when the number of digits differ. solution: manipulate ctr before testing Change-Id: I5e19f96a5ac1081a6cb9791642faec34aa922389 Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/21031 Tested-by: JenkinsCodeReview Reviewed-by: Markus Zolliker --- test/test_params.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_params.py b/test/test_params.py index ae6b0c7..a3f8f09 100644 --- a/test/test_params.py +++ b/test/test_params.py @@ -59,7 +59,9 @@ def test_Parameter(): with pytest.raises(ValueError): Parameter(None, datatype=float) p3 = p1.copy() - assert repr(p1)[12:] == repr(p3)[12:] + assert p1.ctr != p3.ctr + p3.ctr = p1.ctr # manipulate ctr for next line + assert repr(p1) == repr(p3) assert p1.datatype != p2.datatype