[diffoscope] 04/06: Don't assume that the test environment as 4 CPUs in squashfs.test_listing

Chris Lamb chris at chris-lamb.co.uk
Sun Aug 14 11:31:50 CEST 2016


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 36b0ef1fe9a515ef2b8e7b113e535e779fc37e25
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Aug 14 10:05:25 2016 +0100

    Don't assume that the test environment as 4 CPUs in squashfs.test_listing
---
 tests/comparators/test_squashfs.py           | 2 ++
 tests/data/squashfs_listing_expected_diff.in | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/comparators/test_squashfs.py b/tests/comparators/test_squashfs.py
index c0adf36..fad1c61 100644
--- a/tests/comparators/test_squashfs.py
+++ b/tests/comparators/test_squashfs.py
@@ -20,6 +20,7 @@
 import os.path
 import pwd
 import pytest
+import multiprocessing
 from diffoscope.comparators import specialize
 from diffoscope.comparators.binary import FilesystemFile, NonExistingFile
 from diffoscope.comparators.squashfs import SquashfsFile
@@ -65,6 +66,7 @@ def test_listing(differences):
     # Workaround #794096
     for x, y in (
         ('$USER', pwd.getpwuid(1000).pw_name),
+        ('$NUM_PROCESSORS', str(multiprocessing.cpu_count())),
     ):
         expected_diff = expected_diff.replace(x, y)
     assert differences[1].unified_diff == expected_diff
diff --git a/tests/data/squashfs_listing_expected_diff.in b/tests/data/squashfs_listing_expected_diff.in
index c9eac5b..6914195 100644
--- a/tests/data/squashfs_listing_expected_diff.in
+++ b/tests/data/squashfs_listing_expected_diff.in
@@ -1,5 +1,5 @@
 @@ -1,7 +1,7 @@
- Parallel unsquashfs: Using 4 processors
+ Parallel unsquashfs: Using $NUM_PROCESSORS processors
  3 inodes (3 blocks) to write
  
 -drwxr-xr-x $USER/$USER              51 2015-06-24 14:47 

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


More information about the diffoscope mailing list