Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyFstat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gregory Ashton
PyFstat
Commits
367e4a02
Commit
367e4a02
authored
5 years ago
by
Reinhard Prix
Browse files
Options
Downloads
Patches
Plain Diff
test_makefakedata_usecached: add 1s waiting to ensure timestamp changed
- fix test that can otherwise fail (observed on MacOSX)
parent
fa204efb
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!21
Make tests more robust
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests.py
+2
-1
2 additions, 1 deletion
tests.py
with
2 additions
and
1 deletion
tests.py
+
2
−
1
View file @
367e4a02
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment