[Git][reproducible-builds/diffoscope][master] 7 commits: Drop ContainerExtractionError import.

Chris Lamb gitlab at salsa.debian.org
Tue Jun 9 10:21:47 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
acea1e89 by Chris Lamb at 2020-06-09T11:14:16+01:00
Drop ContainerExtractionError import.

- - - - -
61b22c30 by Chris Lamb at 2020-06-09T11:14:39+01:00
Don't assign exception to a variable that we do not use.

- - - - -
f14a0c64 by Chris Lamb at 2020-06-09T11:16:32+01:00
Place the "# noqa" comment in the right place when ignoring some unused imports.

- - - - -
7b050561 by Chris Lamb at 2020-06-09T11:20:41+01:00
Don't mask/no-op an existing test.

- - - - -
a065bc97 by Chris Lamb at 2020-06-09T11:20:55+01:00
Drop unused imports in tests.

- - - - -
c5a803ce by Chris Lamb at 2020-06-09T11:21:13+01:00
Compare text with equality, not "is" identity.

- - - - -
8165a00d by Chris Lamb at 2020-06-09T11:21:23+01:00
Don't alias an open file to a variable when we don't use it.

- - - - -


10 changed files:

- diffoscope/comparators/fsimage.py
- diffoscope/comparators/xml.py
- diffoscope/presenters/html/__init__.py
- tests/comparators/test_elf.py
- tests/comparators/test_ico_image.py
- tests/comparators/test_macho.py
- tests/comparators/test_ocaml.py
- tests/comparators/test_text.py
- tests/comparators/test_utils.py
- tests/test_source.py


Changes:

=====================================
diffoscope/comparators/fsimage.py
=====================================
@@ -23,7 +23,6 @@ import logging
 import os.path
 
 from diffoscope.difference import Difference
-from diffoscope.exc import ContainerExtractionError
 from diffoscope.tools import python_module_missing
 
 from .utils.file import File


=====================================
diffoscope/comparators/xml.py
=====================================
@@ -96,7 +96,7 @@ class XMLFile(File):
         with open(file.path) as f:
             try:
                 file.parsed = _parse(f)
-            except (ExpatError, UnicodeDecodeError) as e:
+            except (ExpatError, UnicodeDecodeError):
                 return False
 
         return True


=====================================
diffoscope/presenters/html/__init__.py
=====================================
@@ -17,8 +17,8 @@
 # You should have received a copy of the GNU General Public License
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
-from .html import (
+from .html import ( # noqa
     HTMLPresenter,
     HTMLDirectoryPresenter,
     JQUERY_SYSTEM_LOCATIONS,
-)  # noqa
+)


=====================================
tests/comparators/test_elf.py
=====================================
@@ -248,7 +248,7 @@ def test_ignore_readelf_errors1_identify(ignore_readelf_errors1):
     assert isinstance(ignore_readelf_errors1, ElfFile)
 
 
-def test_ignore_readelf_errors1_identify(ignore_readelf_errors2):
+def test_ignore_readelf_errors2_identify(ignore_readelf_errors2):
     assert isinstance(ignore_readelf_errors2, ElfFile)
 
 


=====================================
tests/comparators/test_ico_image.py
=====================================
@@ -26,7 +26,6 @@ from ..utils.data import load_fixture, get_data
 from ..utils.tools import (
     skip_unless_tools_exist,
     skip_unless_tool_is_at_least,
-    skip_unless_tool_is_between,
 )
 from .test_jpeg_image import identify_version
 


=====================================
tests/comparators/test_macho.py
=====================================
@@ -20,7 +20,6 @@
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
 import pytest
-import os.path
 
 from diffoscope.config import Config
 from diffoscope.comparators.macho import MachoFile


=====================================
tests/comparators/test_ocaml.py
=====================================
@@ -24,7 +24,7 @@ from diffoscope.comparators.ocaml import OcamlInterfaceFile
 from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.utils.specialize import specialize
 
-from ..utils.data import load_fixture, get_data
+from ..utils.data import get_data
 from ..utils.tools import skip_unless_tool_is_at_least
 from ..utils.nonexisting import assert_non_existing
 
@@ -35,7 +35,7 @@ def ocaml_fixture(prefix):
         input_ = str(tmpdir.join("{}.mli".format(prefix)))
         output = str(tmpdir.join("{}.cmi".format(prefix)))
 
-        with open(input_, "w") as f:
+        with open(input_, "w"):
             pass
 
         subprocess.check_call(("ocamlc", "-c", input_))


=====================================
tests/comparators/test_text.py
=====================================
@@ -20,7 +20,6 @@
 
 import codecs
 
-from diffoscope.comparators.text import TextFile
 from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.utils.specialize import specialize
 


=====================================
tests/comparators/test_utils.py
=====================================
@@ -59,7 +59,7 @@ def test_skip_unless_tools_exist_missing():
 
 def skip_unless_tool_is_at_least():
     func = skip_unless_tool_is_at_least
-    assert func("/missing", 1, 1).name is "skip"
+    assert func("/missing", 1, 1).name == "skip"
     # pytest.skipif().args[0] contains the evaluated statement
     assert func("cat", 1, 1).args[0] is False
     assert func("cat", 1, "1.2d.45+b8").args[0] is True


=====================================
tests/test_source.py
=====================================
@@ -19,7 +19,6 @@
 
 import os
 import glob
-import diffoscope
 import subprocess
 
 from .utils.tools import skip_unless_tool_is_at_least



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/fe446ea2eda5f9649b829985f9fd01b151b81fe5...8165a00d6fdcf751e19e7e53b702f825ce60ae1c

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/fe446ea2eda5f9649b829985f9fd01b151b81fe5...8165a00d6fdcf751e19e7e53b702f825ce60ae1c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200609/f11af1e6/attachment.htm>


More information about the rb-commits mailing list