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 <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
zolliker 2019-08-19 17:12:28 +02:00
parent 74eb33b789
commit ec9a02f5c1

View File

@ -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