From 0e3e763ce871de19db2b8790698d8d38f4dc9c87 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Fri, 20 Jun 2014 11:10:59 +0400 Subject: [PATCH 1/3] Python 3.4 for travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 805698e44..f58d1aa16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ python: - "2.6" - "2.7" - "3.3" + - "3.4" install: - python setup.py -q install script: From e8ba6a6b9487e6a8b74cfe6ac90852520d760523 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Fri, 20 Jun 2014 18:39:39 +0400 Subject: [PATCH 2/3] Fix Python detection for Python 3.x File "", line 1 import sys; print sys.version_info[:2] ^ SyntaxError: invalid syntax --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f58d1aa16..e092a0afb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,6 @@ python: install: - python setup.py -q install script: - - if [[ "$(python -c 'import sys; print sys.version_info[:2]')" == "(2, 6)" ]]; then pip install unittest2; fi + - if [[ "$(python -c 'import sys; print(sys.version_info[:2])')" == "(2, 6)" ]]; then pip install unittest2; fi - py.test --tb=native jsonschema - python -m doctest README.rst From 909970559b0d9b7eaacbc2eee6b135682770ef5a Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Sat, 5 Jul 2014 08:36:12 +0400 Subject: [PATCH 3/3] Workaround for tests in Python 3.4 related bug: http://bugs.python.org/issue21750 --- jsonschema/tests/test_cli.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/jsonschema/tests/test_cli.py b/jsonschema/tests/test_cli.py index 3f43dedfc..dcc1efc61 100644 --- a/jsonschema/tests/test_cli.py +++ b/jsonschema/tests/test_cli.py @@ -22,10 +22,16 @@ class TestParser(unittest.TestCase): FakeValidator = fake_validator() def setUp(self): - self.open = mock.mock_open(read_data='{}') - patch = mock.patch.object(cli, "open", self.open, create=True) - patch.start() - self.addCleanup(patch.stop) + mock_open = mock.mock_open() + patch_open = mock.patch.object(cli, "open", mock_open, create=True) + patch_open.start() + self.addCleanup(patch_open.stop) + + mock_json_load = mock.Mock() + mock_json_load.return_value = {} + patch_json_load = mock.patch("json.load") + patch_json_load.start() + self.addCleanup(patch_json_load.stop) def test_find_validator_by_fully_qualified_object_name(self): arguments = cli.parse_args(