hynek / characteristic

Please use attrs instead!
https://attrs.readthedocs.io/
MIT License
84 stars 19 forks source link

14.0.0: Tests failed with Python 2.7.8/3.4.1 #17

Closed felixonmars closed 10 years ago

felixonmars commented 10 years ago

Hi, I'm getting tests failures on Arch Linux x86_64, with either Python 2.7.8 or 3.4.1.

Failures with Python 3.4.1:

============================= test session starts ==============================
platform linux -- Python 3.4.1 -- py-1.4.23 -- pytest-2.6.1
collected 61 items

test_characteristic.py ...........................................F........F........

=================================== FAILURES ===================================
____________________ TestWithInit.test_deprecation_defaults ____________________

self = <test_characteristic.TestWithInit object at 0x7fdb2307f978>

    def test_deprecation_defaults(self):
        """
            Emits a DeprecationWarning if `defaults` is used.
            """
        with warnings.catch_warnings(record=True) as w:
            @attributes(["a"], create_init=False)
            class C(object):
                pass
>       assert (
            '`create_init` has been deprecated in 14.0, please use '
            '`apply_with_init`.'
        ) == w[0].message.args[0]
E       IndexError: list index out of range

test_characteristic.py:480: IndexError
_________________ TestAttributes.test_deprecation_create_init __________________

self = <test_characteristic.TestAttributes object at 0x7fdb23718cf8>

    def test_deprecation_create_init(self):
        """
            Emits a DeprecationWarning if `create_init` is used.
            """
        with warnings.catch_warnings(record=True) as w:
            @attributes(["a"], create_init=False)
            class C(object):
                pass
>       assert (
            '`create_init` has been deprecated in 14.0, please use '
            '`apply_with_init`.'
        ) == w[0].message.args[0]
E       IndexError: list index out of range

test_characteristic.py:595: IndexError
===================== 2 failed, 59 passed in 0.13 seconds ======================

With Python 2.7.8:

============================= test session starts ==============================
platform linux2 -- Python 2.7.8 -- py-1.4.23 -- pytest-2.6.1
collected 61 items

test_characteristic.py ...........................................F........F........

=================================== FAILURES ===================================
____________________ TestWithInit.test_deprecation_defaults ____________________

self = <test_characteristic.TestWithInit object at 0x7f05c8345690>

    def test_deprecation_defaults(self):
        """
            Emits a DeprecationWarning if `defaults` is used.
            """
        with warnings.catch_warnings(record=True) as w:
            @attributes(["a"], create_init=False)
            class C(object):
                pass
>       assert (
            '`create_init` has been deprecated in 14.0, please use '
            '`apply_with_init`.'
        ) == w[0].message.args[0]
E       IndexError: list index out of range

test_characteristic.py:480: IndexError
_________________ TestAttributes.test_deprecation_create_init __________________

self = <test_characteristic.TestAttributes object at 0x7f05c80e4dd0>

    def test_deprecation_create_init(self):
        """
            Emits a DeprecationWarning if `create_init` is used.
            """
        with warnings.catch_warnings(record=True) as w:
            @attributes(["a"], create_init=False)
            class C(object):
                pass
>       assert (
            '`create_init` has been deprecated in 14.0, please use '
            '`apply_with_init`.'
        ) == w[0].message.args[0]
E       IndexError: list index out of range

test_characteristic.py:595: IndexError
===================== 2 failed, 59 passed in 0.11 seconds ======================
hynek commented 10 years ago

Hi, those tests require activated deprecation warnings. tox -e py27 and tox -e py34 should work.

I'll look into skipping them if it's not on.

felixonmars commented 10 years ago

Oops, sorry for not checking the params :P

It works here. Many thanks!

hynek commented 10 years ago

I'll keep it open because I want to avoid other people run into it too. :)