Bug 1611002 - configure/test_toolkit_moz_configure.py supports Python 3 r=firefox-build-system-reviewers,mshal

Differential Revision: https://phabricator.services.mozilla.com/D60777

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ricky Stewart 2020-01-30 10:34:51 +00:00
Родитель 407d2d3f91
Коммит ffbd93e65a
5 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -273,8 +273,8 @@ class BaseConfigureTest(unittest.TestCase):
target = []
if mozconfig:
fh, mozconfig_path = tempfile.mkstemp()
os.write(fh, mozconfig)
fh, mozconfig_path = tempfile.mkstemp(text=True)
os.write(fh, six.ensure_binary(mozconfig))
os.close(fh)
else:
mozconfig_path = os.path.join(os.path.dirname(__file__), 'data',

Просмотреть файл

@ -6,9 +6,9 @@ from __future__ import absolute_import, print_function, unicode_literals
import os
from StringIO import StringIO
from buildconfig import topsrcdir
from common import BaseConfigureTest
from six import StringIO
from mozunit import MockedOpen, main
from mozbuild.configure.options import InvalidOptionError
from mozbuild.configure.util import Version
@ -115,6 +115,7 @@ class TestToolkitMozConfigure(BaseConfigureTest):
func(Version('1.5'), Version('1.1'), Version('1.0'), False)
out.truncate(0)
out.seek(0)
with self.assertRaises(SystemExit):
func(None, Version('1.0'), False, False)
@ -125,6 +126,7 @@ class TestToolkitMozConfigure(BaseConfigureTest):
)
out.truncate(0)
out.seek(0)
with self.assertRaises(SystemExit):
func(None, Version('1.0'), Version('1.0'), False)
@ -135,6 +137,7 @@ class TestToolkitMozConfigure(BaseConfigureTest):
)
out.truncate(0)
out.seek(0)
with self.assertRaises(SystemExit):
func(None, Version('1.0'), Version('1.0'), Version('1.0'))
@ -145,6 +148,7 @@ class TestToolkitMozConfigure(BaseConfigureTest):
)
out.truncate(0)
out.seek(0)
with self.assertRaises(SystemExit):
func(Version('1.0'), Version('1.1'), Version('1.0'), False)
@ -154,6 +158,7 @@ class TestToolkitMozConfigure(BaseConfigureTest):
)
out.truncate(0)
out.seek(0)
with self.assertRaises(SystemExit):
func(Version('1.0'), True, Version('1.0.1'), False)

Просмотреть файл

@ -12,6 +12,7 @@ subsuite = mozbuild
[configure/test_options.py]
[configure/test_toolchain_configure.py]
[configure/test_toolchain_helpers.py]
[configure/test_toolkit_moz_configure.py]
[configure/test_util.py]
[controller/test_ccachestats.py]
[controller/test_clobber.py]

Просмотреть файл

@ -16,7 +16,6 @@ skip-if = (os == "win")
[compilation/test_warnings.py]
[configure/lint.py]
[configure/test_lint.py]
[configure/test_toolkit_moz_configure.py]
[frontend/test_context.py]
[frontend/test_emitter.py]
[frontend/test_namespaces.py]

Просмотреть файл

@ -10,11 +10,12 @@
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='mozbuild.util', _import='ensure_unicode')
@imports(_from='mozbuild.util', _import='system_encoding')
@imports(_from='six', _import='itervalues')
@imports('__sandbox__')
def all_configure_options():
result = []
previous = None
for option in __sandbox__._options.itervalues():
for option in itervalues(__sandbox__._options):
# __sandbox__._options contains items for both option.name and
# option.env. But it's also an OrderedDict, meaning both are
# consecutive.