Skip to content
Snippets Groups Projects
Commit 367e4a02 authored by Reinhard Prix's avatar Reinhard Prix
Browse files

test_makefakedata_usecached: add 1s waiting to ensure timestamp changed

- fix test that can otherwise fail (observed on MacOSX)
parent fa204efb
No related branches found
No related tags found
1 merge request!21Make tests more robust
...@@ -5,7 +5,7 @@ import shutil ...@@ -5,7 +5,7 @@ import shutil
import pyfstat import pyfstat
import lalpulsar import lalpulsar
import logging import logging
import time
class Test(unittest.TestCase): class Test(unittest.TestCase):
outdir = "TestData" outdir = "TestData"
...@@ -85,6 +85,7 @@ class Writer(Test): ...@@ -85,6 +85,7 @@ class Writer(Test):
Writer.run_makefakedata() Writer.run_makefakedata()
time_second = os.path.getmtime(Writer.sftfilepath) time_second = os.path.getmtime(Writer.sftfilepath)
self.assertTrue(time_first == time_second) self.assertTrue(time_first == time_second)
time.sleep(1) # make sure timestamp is actually different!
os.system("touch {}".format(Writer.config_file_name)) os.system("touch {}".format(Writer.config_file_name))
Writer.run_makefakedata() Writer.run_makefakedata()
time_third = os.path.getmtime(Writer.sftfilepath) time_third = os.path.getmtime(Writer.sftfilepath)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment