Skip to content

Commit

Permalink
Fixes Python3 tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bfloch committed Nov 4, 2019
1 parent 0c322d1 commit c07bc4f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/rez/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,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({
Expand Down Expand Up @@ -129,6 +122,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")
Expand Down

0 comments on commit c07bc4f

Please sign in to comment.