Bug 1313259 - Fix some preprocessor unit tests to actually do the tests they're supposed to do. r?gps draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 27 Oct 2016 10:24:27 +0900
changeset 429987 aeea9c860544abf89640fa2cf88d765c53bbc7ab
parent 429591 97d5eb039b326c6434cf8c7d09f0820bbf92af09
child 430136 b4d600dc65411a6cc7624937f3e03a4948b62b02
child 430142 f71785cdb341f241e1683bf54a780d188dc70579
push id33716
push userbmo:mh+mozilla@glandium.org
push dateThu, 27 Oct 2016 01:30:39 +0000
reviewersgps
bugs1313259
milestone52.0a1
Bug 1313259 - Fix some preprocessor unit tests to actually do the tests they're supposed to do. r?gps
python/mozbuild/mozbuild/test/test_preprocessor.py
--- a/python/mozbuild/mozbuild/test/test_preprocessor.py
+++ b/python/mozbuild/mozbuild/test/test_preprocessor.py
@@ -614,23 +614,23 @@ class TestPreprocessor(unittest.TestCase
                               '//@line 6 "CWD/f.js"\n'
                               'fin\n').replace('CWD/',
                                                os.getcwd() + os.path.sep))
 
     def test_include_missing_file(self):
         with MockedOpen({'f': '#include foo\n'}):
             with self.assertRaises(Preprocessor.Error) as e:
                 self.pp.do_include('f')
-                self.assertEqual(e.key, 'FILE_NOT_FOUND')
+            self.assertEqual(e.exception.key, 'FILE_NOT_FOUND')
 
     def test_include_undefined_variable(self):
         with MockedOpen({'f': '#filter substitution\n#include @foo@\n'}):
             with self.assertRaises(Preprocessor.Error) as e:
                 self.pp.do_include('f')
-                self.assertEqual(e.key, 'UNDEFINED_VAR')
+            self.assertEqual(e.exception.key, 'UNDEFINED_VAR')
 
     def test_include_literal_at(self):
         files = {
             '@foo@': '#define foo foobarbaz\n',
             'f': '#include @foo@\n#filter substitution\n@foo@\n',
         }
 
         with MockedOpen(files):