Bug 1254374 - Remove the old TestConfigure.test_imports test. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 12 Apr 2016 15:00:40 +0900
changeset 292916 907ac5daf5b0295e73a983f73850be73fda87329
parent 292915 06cc94fa4cdf0e4d8bf8f6d1a1ded0dcc2841dc9
child 292917 1f39e69e43360f01b78ced4ec8458d791760272b
push id30170
push usercbook@mozilla.com
push dateWed, 13 Apr 2016 09:53:56 +0000
treeherdermozilla-central@564b225d5535 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1254374, 1256573
milestone48.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 1254374 - Remove the old TestConfigure.test_imports test. r=nalexander It now duplicates the test added in bug 1256573, which is actually better.
python/mozbuild/mozbuild/test/configure/data/moz.configure
python/mozbuild/mozbuild/test/configure/test_configure.py
--- a/python/mozbuild/mozbuild/test/configure/data/moz.configure
+++ b/python/mozbuild/mozbuild/test/configure/data/moz.configure
@@ -142,32 +142,16 @@ def include_path(path, help):
 
 include(include_path)
 
 # Sandboxed functions can import from modules through the use of the @imports
 # decorator.
 # The order of the decorators matter: @imports needs to appear after other
 # decorators.
 option('--with-imports', nargs='?', help='Imports')
-@depends('--with-imports')
-@imports(_from='mozbuild.configure.options', _import='OptionValue')
-def with_imports(value):
-    if value:
-        return isinstance(value, OptionValue)
-
-set_config('IMPORTS', with_imports)
-
-# Trying to import manually will fail at runtime.
-@depends('--with-imports')
-def with_imports(value):
-    if len(value) and value[0] == 'break':
-        from mozbuild.configure.options import OptionValue
-        return isinstance(value, OptionValue)
-
-set_config('IMPORTS2', with_imports)
 
 # A limited set of functions from os.path are exposed by default.
 @depends('--with-imports')
 def with_imports(value):
     if len(value):
         return os.path.isfile(value[0])
 
 set_config('IS_FILE', with_imports)
--- a/python/mozbuild/mozbuild/test/configure/test_configure.py
+++ b/python/mozbuild/mozbuild/test/configure/test_configure.py
@@ -223,24 +223,16 @@ class TestConfigure(unittest.TestCase):
         config = self.get_config(env={'CC': 'gcc'})
         self.assertIn('CFLAGS', config)
         self.assertEquals(config['CFLAGS'], ['-Werror=foobar'])
 
         config = self.get_config(env={'CC': 'clang'})
         self.assertNotIn('CFLAGS', config)
 
     def test_imports(self):
-        config = self.get_config(['--with-imports'])
-        self.assertIn('IMPORTS', config)
-        self.assertEquals(config['IMPORTS'], True)
-
-        with self.assertRaises(ImportError):
-            self.get_config(['--with-imports=break'])
-
-    def test_imports(self):
         config = {}
         out = StringIO()
         sandbox = ConfigureSandbox(config, {}, [], out, out)
 
         with self.assertRaises(ImportError):
             exec(textwrap.dedent('''
                 @template
                 def foo():