Python 3: provide a predictive FilterSet.__repr__() implementation
There's a difference on how Python 2 and 3 represents a set(), which is true
for the set derived FilterSet. It just happens the a tree fingerprint
depends on its environment, which depends on the FilterSet representation.
Let's provide a predictive __repr__ implementation, and consequently, a
predictive fingerprint for Trees across Python versions.
This fixes the following unittest failure on Python 3:
FAIL: test_fingerprint (selftests.unit.test_tree.TreeNode)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/cleber/src/avocado/avocado/selftests/unit/test_tree.py", line 63, in test_fingerprint
"/foo{},{},FilterSet([]),FilterSet([])")
AssertionError: '/foo{},{},FilterSet(),FilterSet()' != '/foo{},{},FilterSet([]),FilterSet([])'
- /foo{},{},FilterSet(),FilterSet()
+ /foo{},{},FilterSet([]),FilterSet([])
? ++ ++
Signed-off-by: NCleber Rosa <crosa@redhat.com>
Showing
想要评论请 注册 或 登录