Skip to content
Snippets Groups Projects
Unverified Commit 129ffd7b authored by Amber Brown's avatar Amber Brown Committed by GitHub
Browse files

Merge pull request #3498 from OlegGirko/fix_attrs_syntax


* 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: default avatarOleg Girko <ol@infoserver.lv>
parents ea752bdd 85354bb1
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment