зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1473498
- [mach] Enable test_entry_points with Python 3 r=firefox-build-system-reviewers,chmanchester
Differential Revision: https://phabricator.services.mozilla.com/D36100 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
3824b084b6
Коммит
975f664521
|
@ -339,14 +339,15 @@ To see more help for a specific command, run:
|
|||
orig_env = dict(os.environ)
|
||||
|
||||
try:
|
||||
if stdin.encoding is None:
|
||||
sys.stdin = codecs.getreader('utf-8')(stdin)
|
||||
if sys.version_info < (3, 0):
|
||||
if stdin.encoding is None:
|
||||
sys.stdin = codecs.getreader('utf-8')(stdin)
|
||||
|
||||
if stdout.encoding is None:
|
||||
sys.stdout = codecs.getwriter('utf-8')(stdout)
|
||||
if stdout.encoding is None:
|
||||
sys.stdout = codecs.getwriter('utf-8')(stdout)
|
||||
|
||||
if stderr.encoding is None:
|
||||
sys.stderr = codecs.getwriter('utf-8')(stderr)
|
||||
if stderr.encoding is None:
|
||||
sys.stderr = codecs.getwriter('utf-8')(stderr)
|
||||
|
||||
# Allow invoked processes (which may not have a handle on the
|
||||
# original stdout file descriptor) to know if the original stdout
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
try:
|
||||
|
@ -39,8 +40,10 @@ class TestBase(unittest.TestCase):
|
|||
|
||||
stdout = StringIO()
|
||||
stderr = StringIO()
|
||||
stdout.encoding = 'UTF-8'
|
||||
stderr.encoding = 'UTF-8'
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
stdout.encoding = 'UTF-8'
|
||||
stderr.encoding = 'UTF-8'
|
||||
|
||||
try:
|
||||
result = m.run(argv, stdout=stdout, stderr=stderr)
|
||||
|
|
|
@ -7,7 +7,6 @@ skip-if = python == 3
|
|||
skip-if = python == 3
|
||||
[test_dispatcher.py]
|
||||
[test_entry_point.py]
|
||||
skip-if = python == 3
|
||||
[test_error_output.py]
|
||||
skip-if = python == 3
|
||||
[test_logger.py]
|
||||
|
|
|
@ -39,9 +39,9 @@ class TestEntryPoints(TestBase):
|
|||
def test_load_entry_point_from_directory(self, mock):
|
||||
# Ensure parent module is present otherwise we'll (likely) get
|
||||
# an error due to unknown parent.
|
||||
if b'mach.commands' not in sys.modules:
|
||||
mod = imp.new_module(b'mach.commands')
|
||||
sys.modules[b'mach.commands'] = mod
|
||||
if 'mach.commands' not in sys.modules:
|
||||
mod = imp.new_module('mach.commands')
|
||||
sys.modules['mach.commands'] = mod
|
||||
|
||||
mock.return_value = [Entry([self.provider_dir])]
|
||||
# Mach error raised due to conditions_invalid.py
|
||||
|
|
Загрузка…
Ссылка в новой задаче