From 30093dc4eda9edcc8fffe89c66da233d39c8fedc Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 10 Jan 2018 00:57:11 -0800 Subject: [PATCH] Add Python 3.7 to CI unit test matrix. (#34680) * Add Python 3.7 to CI unit test matrix. * Fix `os.errno` reference to be `errno`. * Update test_aci unit test for Python 3.7. --- shippable.yml | 1 + test/units/module_utils/network/aci/test_aci.py | 2 ++ test/units/modules/cloud/amazon/placebo_fixtures.py | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/shippable.yml b/shippable.yml index c494a5b4446..fb93c9b8fb2 100644 --- a/shippable.yml +++ b/shippable.yml @@ -14,6 +14,7 @@ matrix: - env: T=units/2.7 - env: T=units/3.5 - env: T=units/3.6 + - env: T=units/3.7 - env: T=windows/1 - env: T=windows/2 diff --git a/test/units/module_utils/network/aci/test_aci.py b/test/units/module_utils/network/aci/test_aci.py index 5cfff81aebc..54a81f8a83f 100644 --- a/test/units/module_utils/network/aci/test_aci.py +++ b/test/units/module_utils/network/aci/test_aci.py @@ -229,6 +229,8 @@ class AciRest(unittest.TestCase): error_text = to_native(u"Unable to parse output as XML, see 'raw' output. None (line 0)", errors='surrogate_or_strict') elif PY2: error_text = "Unable to parse output as XML, see 'raw' output. Document is empty, line 1, column 1 (line 1)" + elif sys.version_info >= (3, 7): + error_text = to_native(u"Unable to parse output as XML, see 'raw' output. None (line 0)", errors='surrogate_or_strict') else: error_text = "Unable to parse output as XML, see 'raw' output. Document is empty, line 1, column 1 (, line 1)" diff --git a/test/units/modules/cloud/amazon/placebo_fixtures.py b/test/units/modules/cloud/amazon/placebo_fixtures.py index fd5cf841da7..5c49845817e 100644 --- a/test/units/modules/cloud/amazon/placebo_fixtures.py +++ b/test/units/modules/cloud/amazon/placebo_fixtures.py @@ -1,3 +1,4 @@ +import errno import os import time import mock @@ -64,7 +65,7 @@ def placeboify(request, monkeypatch): # make sure the directory for placebo test recordings is available os.makedirs(recordings_path) except OSError as e: - if e.errno != os.errno.EEXIST: + if e.errno != errno.EEXIST: raise pill = placebo.attach(session, data_path=recordings_path)