Skip to content

assertEquals() is deprecated #11

Open

Description

@mtelka

... and so tests fails with recent Python, for example:

__ BackwardsCompatibilityTestCase.test_incode_not_found_error_is_value_error ___

self = <ukpostcodeparser.test.parser.BackwardsCompatibilityTestCase testMethod=test_incode_not_found_error_is_value_error>

    def test_incode_not_found_error_is_value_error(self):
        """
        Previous iterations of the code raised a ValueError exception when incode was expected but
        not found.
        New exceptions should be caught in the same way in case any code relies on it.
        """

        with self.assertRaises(ValueError) as cm:
            parse_uk_postcode('N16', True, True)
>       self.assertEquals(cm.exception.__class__, IncodeNotFoundError)
        ^^^^^^^^^^^^^^^^^
E       AttributeError: 'BackwardsCompatibilityTestCase' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

ukpostcodeparser/test/parser.py:21: AttributeError

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions