From 0149b538ab2915a59db371b68de50e051e20c55f Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Fri, 3 Jul 2015 11:30:53 +0200 Subject: [PATCH] Fix tests on Python 2.6 Fixes #14 and #15. --- setup.py | 2 +- tests/test_dunders.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 4520e1be..83be9fa9 100644 --- a/setup.py +++ b/setup.py @@ -98,7 +98,7 @@ if __name__ == "__main__": install_requires=[ ], tests_require=[ - "pytest", + "pytest>=2.7.2", # see https://github.com/hynek/attrs/issues/14 "zope.interface", ], cmdclass={ diff --git a/tests/test_dunders.py b/tests/test_dunders.py index 3ca406ce..90f723a8 100644 --- a/tests/test_dunders.py +++ b/tests/test_dunders.py @@ -206,8 +206,10 @@ class TestAddInit(object): with pytest.raises(TypeError) as e: C(a=1, b=2) - msg = e.value if PY26 else e.value.args[0] - assert "__init__() got an unexpected keyword argument 'a'" == msg + assert ( + "__init__() got an unexpected keyword argument 'a'" == + e.value.args[0] + ) def test_sets_attributes(self): """