[diffoscope] 05/05: tests.test_progress: flake8 file

Chris Lamb chris at chris-lamb.co.uk
Thu Jan 11 09:59:48 UTC 2018


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit 14317f58e05f05546827cae3b4d611d28148b467
Author: Chris Lamb <lamby at debian.org>
Date:   Thu Jan 11 12:54:15 2018 +0530

    tests.test_progress: flake8 file
---
 tests/test_progress.py | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/tests/test_progress.py b/tests/test_progress.py
index 2c93a4a..04352ed 100644
--- a/tests/test_progress.py
+++ b/tests/test_progress.py
@@ -22,10 +22,11 @@ import sys
 import json
 import pytest
 
+from distutils.version import LooseVersion
+
 from diffoscope.main import main
 from diffoscope.progress import ProgressManager, StatusFD
 
-from distutils.version import LooseVersion as vcls
 from .utils.tools import skip_unless_module_exists
 
 TEST_TAR1_PATH = os.path.join(os.path.dirname(__file__), 'data', 'test1.tar')
@@ -42,24 +43,24 @@ def run(capsys, *args):
 
 
 def progressbar_version():
-  import progressbar
+    import progressbar
 
-  return progressbar.__version__
+    return progressbar.__version__
 
 
 @pytest.fixture
 def progressbar_err():
-  # This fixture returns an expected error message depending
-  # on progressbar version, from the lowest to the highest.
-  expected_err = { '3.19' : 'ETA', '3.34' : ''}
+    # This fixture returns an expected error message depending on progressbar
+    # version, from the lowest to the highest.
+    expected_err = {'3.19': 'ETA', '3.34': ''}
 
-  actual_ver = progressbar_version()
+    actual_ver = progressbar_version()
 
-  for k,v in expected_err.items():
-    if vcls(actual_ver) < vcls(k):
-      return v
+    for k, v in expected_err.items():
+        if LooseVersion(actual_ver) < LooseVersion(k):
+            return v
 
-  return ''
+    return ''
 
 
 @skip_unless_module_exists('progressbar')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git



More information about the Reproducible-commits mailing list