starhawking / python-terrascript

Create Terraform files using Python scripts.
BSD 2-Clause "Simplified" License
515 stars 76 forks source link

Travis-CI: json.JSONDecodeError not available in Python 3.4 #85

Closed mjuenema closed 4 years ago

mjuenema commented 4 years ago

Change tests/shared.py:assert_deep_equal() to catch ValueError instead of json.JSONDecodeError as the latter has only been introduced in Python 3.4. Alternatively drop Travis-CI tests for Python3.4

Traceback (most recent call last):

  File "/home/travis/virtualenv/python3.4.8/lib/python3.4/site-packages/nose/case.py", line 198, in runTest

    self.test(*self.arg)

  File "/home/travis/build/mjuenema/python-terrascript/tests/test_004.py", line 15, in test

    assert_equals_json(config, 'test_004.tf.json')

  File "/home/travis/build/mjuenema/python-terrascript/tests/shared.py", line 24, in assert_deep_equal

    except json.decoder.JSONDecodeError:

AttributeError: 'module' object has no attribute 'JSONDecodeError'

exception json.JSONDecodeError(msg, doc, pos)

    Subclass of ValueError with the following additional attributes:

    msg
        The unformatted error message.

    doc
        The JSON document being parsed.

    pos
        The start index of doc where parsing failed.

    lineno
        The line corresponding to pos.

    colno
        The column corresponding to pos.

    New in version 3.5.
mjuenema commented 4 years ago

Removed Python 3.4 from .travis.yml.