From 367e4a02eef92ebbdbad42e0090c155f8ba24d48 Mon Sep 17 00:00:00 2001 From: Reinhard Prix <reinhard.prix@aei.mpg.de> Date: Tue, 23 Jul 2019 19:03:54 +0200 Subject: [PATCH] test_makefakedata_usecached: add 1s waiting to ensure timestamp changed - fix test that can otherwise fail (observed on MacOSX) --- tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests.py b/tests.py index f3a43a0..26275f5 100644 --- a/tests.py +++ b/tests.py @@ -5,7 +5,7 @@ import shutil import pyfstat import lalpulsar import logging - +import time class Test(unittest.TestCase): outdir = "TestData" @@ -85,6 +85,7 @@ class Writer(Test): Writer.run_makefakedata() time_second = os.path.getmtime(Writer.sftfilepath) self.assertTrue(time_first == time_second) + time.sleep(1) # make sure timestamp is actually different! os.system("touch {}".format(Writer.config_file_name)) Writer.run_makefakedata() time_third = os.path.getmtime(Writer.sftfilepath) -- GitLab