From 9b65f62ce1419c026278bc6ed94429901e9c8111 Mon Sep 17 00:00:00 2001 From: Edwin Takahashi Date: Mon, 30 Dec 2019 18:02:23 +0000 Subject: [PATCH] Bug 1606182 - add python-test using python3 to make check r=Callek Changes: Fix the import statement that causes issues in python3. Differential Revision: https://phabricator.services.mozilla.com/D58383 --HG-- extra : moz-landing-system : lando --- modules/libpref/test/test_generate_static_pref_list.py | 5 ++++- testing/testsuite-targets.mk | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/libpref/test/test_generate_static_pref_list.py b/modules/libpref/test/test_generate_static_pref_list.py index 2498c141003c..7aee78dab697 100644 --- a/modules/libpref/test/test_generate_static_pref_list.py +++ b/modules/libpref/test/test_generate_static_pref_list.py @@ -10,7 +10,10 @@ import sys import unittest import yaml from os import path -from StringIO import StringIO +try: + from StringIO import StringIO +except ImportError: + from io import StringIO sys.path.append(path.join(path.dirname(__file__), "..")) from init.generate_static_pref_list import generate_code diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk index 7965fd50308d..fecd15ee7241 100644 --- a/testing/testsuite-targets.mk +++ b/testing/testsuite-targets.mk @@ -269,6 +269,9 @@ check:: @echo "Starting 'mach python-test' with -j$(cores)" @$(topsrcdir)/mach --log-no-times python-test -j$(cores) --subsuite default @echo "Finished 'mach python-test' successfully" + @echo "Starting 'mach python-test' with --python $(PYTHON3) -j$(cores)" + @$(topsrcdir)/mach --log-no-times python-test --python python3 -j$(cores) --subsuite default + @echo "Finished 'mach python-test' with py3 successfully" .PHONY: \