From 2665518317f7386bf374e4e945e5c8d8353fefc8 Mon Sep 17 00:00:00 2001 From: Blazej Floch Date: Mon, 4 Nov 2019 16:26:39 -0500 Subject: [PATCH] Fixes Python3 tests In python 3 the caught execption is not recoverable in an override. Since we are testing for expected failure it is probably ok to not expect any tests after the failure to pass. --- src/rez/tests/test_config.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rez/tests/test_config.py b/src/rez/tests/test_config.py index eab5cbacf..f7ab096f8 100644 --- a/src/rez/tests/test_config.py +++ b/src/rez/tests/test_config.py @@ -95,13 +95,6 @@ def test_conditional_overrides(self): c.validate_data() - # Schema validation still works? - c.override("debug_none", PlatformDependent({ - platform_name: "Wrong Type", - })) - with self.assertRaises(ConfigurationError): - c.validate_data() - # Missing valid key or fallback with self.assertRaises(ConfigurationError): c.override("debug_none", PlatformDependent({ @@ -147,6 +140,14 @@ def test_conditional_overrides(self): self.assertEqual(c.plugins.release_hook.emailer.sender, "joe.bloggs") self.assertListEqual(c.implicit_packages, ["a list", "of values"]) + with self.assertRaises(ConfigurationError): + # Schema validation still works? + c.override("debug_none", PlatformDependent({ + platform_name: "Wrong Type", + })) + c.validate_data() + + def test_conditional_in_file(self): """Test package config overrides.""" conf = os.path.join(self.config_path, "test_conditional.py")