320 self.assert_(check_expected(result,
321 "Invalid literals specification. literals must be a sequence of characters\n"))
322
323import os324import subprocess
325import shutil
326
964 lexer = lex.lex()
965
966 # Run a preprocessor
967 import sys968 with open(sys.argv[1]) as f:
969 input = f.read()
970
7import builtins
8import collections
9import threading
10import collections.abc as cabc 11
12from xonsh.history.base import History
13import xonsh.tools as xt
114if PYTHON_VERSION_INFO >= (3, 5, 0):
115 # pylint: disable=unused-import
116 # pylint: disable=no-name-in-module
117 from ast import MatMult, AsyncFunctionDef, AsyncWith, AsyncFor, Await118else:
119 MatMult = AsyncFunctionDef = AsyncWith = AsyncFor = Await = None
120
20from tests.compat import unittest
21
22from gitsome.github import GitHub
23from tests.data.markdown import formatted_markdown, raw_markdown, ssl_error24
25
26class WebViewerTest(unittest.TestCase):
Imports for the same package are scattered and not grouped together. It is recommended to keep the imports from the same package together. It makes the code easier to read.
Not preferred:
import os
import sys
from os import listdir
import time
from os.path import isfile, join
Preferred:
import os
from os import listdir
from os.path import isfile, join
import sys
import time