Bug 1473498 - [mach] Enable test_config with Python 3 r=firefox-build-system-reviewers,chmanchester
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Tue, 02 Jul 2019 20:59:03 +0000
changeset 540706 7123c3146d812a050e52941c008c3b549abcde0c
parent 540705 152598dd91a82111b96bbf85e33e787702e19214
child 540707 3416303a9b4a7c49272e956f9a83395e4e4ad985
push id11529
push userarchaeopteryx@coole-files.de
push dateThu, 04 Jul 2019 15:22:33 +0000
treeherdermozilla-beta@ebb510a784b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, chmanchester
bugs1473498
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1473498 - [mach] Enable test_config with Python 3 r=firefox-build-system-reviewers,chmanchester Depends on D36100 Differential Revision: https://phabricator.services.mozilla.com/D36101
python/mach/mach/test/python.ini
python/mach/mach/test/test_config.py
--- a/python/mach/mach/test/python.ini
+++ b/python/mach/mach/test/python.ini
@@ -1,15 +1,14 @@
 [DEFAULT]
 subsuite = mach
 
 [test_conditions.py]
 skip-if = python == 3
 [test_config.py]
-skip-if = python == 3
 [test_dispatcher.py]
 [test_entry_point.py]
 [test_error_output.py]
 skip-if = python == 3
 [test_logger.py]
 skip-if = python == 3
 [test_telemetry.py]
 skip-if = python == 3
--- a/python/mach/mach/test/test_config.py
+++ b/python/mach/mach/test/test_config.py
@@ -135,17 +135,18 @@ class TestConfigSettings(unittest.TestCa
 
     def test_assignment_validation(self):
         s = ConfigSettings()
         s.register_provider(Provider2)
 
         a = s.a
 
         # Assigning an undeclared setting raises.
-        with self.assertRaises(AttributeError):
+        exc_type = AttributeError if sys.version_info < (3, 0) else KeyError
+        with self.assertRaises(exc_type):
             a.undefined = True
 
         with self.assertRaises(KeyError):
             a['undefined'] = True
 
         # Basic type validation.
         a.string = 'foo'
         a.string = 'foo'