From ca62d02e8ef9eb02e41adb40986fbe78f0b770ae Mon Sep 17 00:00:00 2001
From: Tiago Freitas Pereira <tiagofrepereira@gmail.com>
Date: Mon, 4 May 2020 09:08:48 +0200
Subject: [PATCH] Fixed CSVScoreWriter tests

---
 bob/bio/base/test/test_vanilla_biometrics.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/bob/bio/base/test/test_vanilla_biometrics.py b/bob/bio/base/test/test_vanilla_biometrics.py
index 99920add..ff7d7c4d 100644
--- a/bob/bio/base/test/test_vanilla_biometrics.py
+++ b/bob/bio/base/test/test_vanilla_biometrics.py
@@ -191,13 +191,16 @@ def test_checkpoint_bioalg_as_transformer():
                 database.probes(),
                 allow_scoring_with_all_biometric_references=database.allow_scoring_with_all_biometric_references,
             )
-
-            filename = os.path.join(dir_name, "concatenated_scores.txt")
-            score_writer.concatenate_write_scores(scores, filename)
+            if with_dask:
+                scores = scores.compute(scheduler="single-threaded")
 
             if isinstance(score_writer, CSVScoreWriter):
-                assert len(open(filename).readlines()) == 101
+                base_path = os.path.join(dir_name, "concatenated_scores")
+                score_writer.concatenate_write_scores(scores, base_path)
+                assert len(open(os.path.join(base_path, "chunk_0.csv")).readlines()) == 101
             else:
+                filename = os.path.join(dir_name, "concatenated_scores.txt")
+                score_writer.concatenate_write_scores(scores, filename)
                 assert len(open(filename).readlines()) == 100
 
         run_pipeline(False)
-- 
GitLab