Bug 1547162 Part 1 - Remove unused variables and imports in import-test.py. r=dbaron
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 09 May 2019 23:30:17 +0000
changeset 532159 82c216e530eaaa56d5b59f95542f6835465241ff
parent 532158 1df96f5e640231e8ddbc8ed1dadaef69b55d4e62
child 532160 108d96d047cd3ee2ec1750a802276c14141804c6
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1547162
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547162 Part 1 - Remove unused variables and imports in import-test.py. r=dbaron This is discovered by running "flake8 import-tests.py" locally. Differential Revision: https://phabricator.services.mozilla.com/D30404
layout/reftests/w3c-css/import-tests.py
--- a/layout/reftests/w3c-css/import-tests.py
+++ b/layout/reftests/w3c-css/import-tests.py
@@ -5,17 +5,16 @@
 import os
 from optparse import OptionParser
 from subprocess import Popen, PIPE
 import xml.dom.minidom
 import html5lib
 import fnmatch
 import shutil
 import string
-import sys
 import re
 
 # FIXME:
 #   * Import more tests rather than just the very limited set currently
 #     chosen.
 #   * Read in a (checked-in) input file with a list of test assertions
 #     expected to fail.
 #   * Read in a (checked-in) input file with a list of reference choices
@@ -167,17 +166,16 @@ def copy_support_files(test, dirname):
             copy_file(test, full_srcname, destname, True)
 
 def map_file(srcname):
     global gSrcPath
     srcname = to_unix_path_sep(os.path.normpath(srcname))
     if srcname in filemap:
         return filemap[srcname]
     destname = to_unix_path_sep(os.path.relpath(srcname, gSrcPath))
-    destdir = os.path.dirname(destname)
     filemap[srcname] = destname
     load_flags_for(srcname, destname)
     copy_file(destname, srcname, destname, False)
     copy_support_files(destname, os.path.dirname(srcname))
     return destname
 
 def load_flags_for(srcname, destname):
     global gTestFlags
@@ -255,17 +253,16 @@ AHEM_DECL_XML = """<style type="text/css
 """ + AHEM_DECL_CONTENT + """
 ]]></style>
 """
 
 def copy_and_prefix(test, aSourceFileName, aDestFileName, isSupportFile=False):
     global gTestFlags, gPrefixRegexp
     newFile = open(aDestFileName, 'wb')
     unPrefixedFile = open(aSourceFileName, 'rb')
-    testName = aDestFileName[len(gDestPath)+1:]
     ahemFontAdded = False
     for line in unPrefixedFile:
         replacementLine = line
         searchRegex = "\s*<style\s*"
 
         if not isSupportFile and not ahemFontAdded and 'ahem' in gTestFlags[test] and re.search(searchRegex, line):
             # First put our ahem font declation before the first <style>
             # element