From 6c1ec5a1bdfaed2d13a501fd2441d99c73711adb Mon Sep 17 00:00:00 2001
From: Oleg Girko
Date: Tue, 10 Jul 2018 00:11:39 +0100
Subject: [PATCH] Use more portable syntax using attrs package.
Newer syntax
attr.ib(factory=dict)
is just a syntactic sugar for
attr.ib(default=attr.Factory(dict))
It was introduced in newest version of attrs package (18.1.0)
and doesn't work with older versions.
We should either require minimum version of attrs to be 18.1.0,
or use older (slightly more verbose) syntax.
Requiring newest version is not a good solution because
Linux distributions may have older version of attrs (17.4.0 in Fedora 28),
and requiring to build (and package)
newer version just to use newer syntactic sugar in only one test
is just too much.
It's much better to fix that test to use older syntax.
Signed-off-by: Oleg Girko
---
tests/server.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/server.py b/tests/server.py
index 46223ccf05..e93f5a7f94 100644
--- a/tests/server.py
+++ b/tests/server.py
@@ -22,7 +22,7 @@ class FakeChannel(object):
wire).
"""
- result = attr.ib(factory=dict)
+ result = attr.ib(default=attr.Factory(dict))
@property
def json_body(self):