Merge pull request #21040 from edx/INCR-388
INCR-388 python3 compatibility
This commit is contained in:
@@ -2,26 +2,27 @@
|
||||
"""
|
||||
Class used for defining and running Bok Choy acceptance test suite
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import os
|
||||
from time import sleep
|
||||
|
||||
from common.test.acceptance.fixtures.course import CourseFixture, FixtureError
|
||||
from paver.easy import call_task, cmdopts, dry, might_call, needs, sh, task
|
||||
|
||||
from paver.easy import sh, cmdopts, task, needs, might_call, call_task, dry
|
||||
from pavelib.utils.test.suites.suite import TestSuite
|
||||
from pavelib.utils.envs import Env
|
||||
from pavelib.utils.test.bokchoy_utils import (
|
||||
clear_mongo, start_servers, check_services, wait_for_test_servers
|
||||
)
|
||||
from pavelib.utils.test.bokchoy_options import (
|
||||
BOKCHOY_IMPORTS_DIR, BOKCHOY_IMPORTS_DIR_DEPR,
|
||||
BOKCHOY_DEFAULT_STORE, BOKCHOY_DEFAULT_STORE_DEPR,
|
||||
BOKCHOY_FASTTEST
|
||||
)
|
||||
from pavelib.utils.test import utils as test_utils
|
||||
from pavelib.utils.timer import timed
|
||||
from common.test.acceptance.fixtures.course import CourseFixture, FixtureError
|
||||
from pavelib.database import update_local_bokchoy_db_from_s3
|
||||
from pavelib.utils.envs import Env
|
||||
from pavelib.utils.test import utils as test_utils
|
||||
from pavelib.utils.test.bokchoy_options import (
|
||||
BOKCHOY_DEFAULT_STORE,
|
||||
BOKCHOY_DEFAULT_STORE_DEPR,
|
||||
BOKCHOY_FASTTEST,
|
||||
BOKCHOY_IMPORTS_DIR,
|
||||
BOKCHOY_IMPORTS_DIR_DEPR
|
||||
)
|
||||
from pavelib.utils.test.bokchoy_utils import check_services, clear_mongo, start_servers, wait_for_test_servers
|
||||
from pavelib.utils.test.suites.suite import TestSuite
|
||||
from pavelib.utils.timer import timed
|
||||
|
||||
try:
|
||||
from pygments.console import colorize
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
Javascript test tasks
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from paver import tasks
|
||||
|
||||
from pavelib import assets
|
||||
from pavelib.utils.envs import Env
|
||||
from pavelib.utils.test import utils as test_utils
|
||||
from pavelib.utils.test.suites.suite import TestSuite
|
||||
from pavelib.utils.envs import Env
|
||||
|
||||
__test__ = False # do not collect
|
||||
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
"""
|
||||
Classes used for defining and running pytest test suites
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
from glob import glob
|
||||
|
||||
from pavelib.utils.envs import Env
|
||||
from pavelib.utils.test import utils as test_utils
|
||||
from pavelib.utils.test.suites.suite import TestSuite
|
||||
from pavelib.utils.envs import Env
|
||||
|
||||
__test__ = False # do not collect
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
from __future__ import print_function
|
||||
"""
|
||||
Show Event outputs.
|
||||
"""
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import json
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
@@ -4,6 +4,8 @@ A linting tool to check for xss vulnerabilities.
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
if __name__ == "__main__":
|
||||
from xsslint.main import main
|
||||
main()
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
"""
|
||||
The main function for the XSS linter.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import argparse
|
||||
import importlib
|
||||
import os
|
||||
import sys
|
||||
from functools import reduce
|
||||
|
||||
from xsslint.reporting import SummaryResults
|
||||
from xsslint.rules import RuleSet
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
"""
|
||||
Utility classes for reporting linter results.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
from six.moves import range
|
||||
|
||||
from xsslint.utils import StringLines
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Custom AST NodeVisitor classes uses for Python xss linting.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import ast
|
||||
import re
|
||||
|
||||
@@ -8,7 +10,6 @@ from xsslint.reporting import ExpressionRuleViolation
|
||||
from xsslint.rules import RuleSet
|
||||
from xsslint.utils import Expression, ParseString, StringLines
|
||||
|
||||
|
||||
ruleset = RuleSet(
|
||||
python_concat_html='python-concat-html',
|
||||
python_deprecated_display_name='python-deprecated-display-name',
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# xsslint config module for edx-platform
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -7,8 +9,7 @@ import sys
|
||||
scripts_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.append(os.path.join(scripts_dir, 'xsslint'))
|
||||
|
||||
from xsslint.linters import JavaScriptLinter, MakoTemplateLinter, PythonLinter, UnderscoreTemplateLinter
|
||||
|
||||
from xsslint.linters import JavaScriptLinter, MakoTemplateLinter, PythonLinter, UnderscoreTemplateLinter # pylint: disable=import-error,wrong-import-position
|
||||
|
||||
# Define the directories that should be ignored by the script.
|
||||
SKIP_DIRS = (
|
||||
|
||||
Reference in New Issue
Block a user