Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
c90fc078
Commit
c90fc078
authored
3 years ago
by
dh00601
Browse files
Options
Downloads
Patches
Plain Diff
fixing tests
parent
01f20e58
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
binarycpython/tests/test_grid.py
+4
-1
4 additions, 1 deletion
binarycpython/tests/test_grid.py
binarycpython/utils/population_extensions/dataIO.py
+4
-2
4 additions, 2 deletions
binarycpython/utils/population_extensions/dataIO.py
with
8 additions
and
3 deletions
binarycpython/tests/test_grid.py
+
4
−
1
View file @
c90fc078
...
...
@@ -27,6 +27,7 @@ TODO: Before running the non-unit tests to cover functions like evolve, we need
import
os
import
sys
import
json
import
gzip
import
unittest
from
binarycpython.utils.functions
import
(
...
...
@@ -343,7 +344,9 @@ class test_export_all_info(unittest.TestCase):
# datadir
settings_filename
=
test_pop
.
export_all_info
(
use_datadir
=
True
)
self
.
assertTrue
(
os
.
path
.
isfile
(
settings_filename
))
with
open
(
settings_filename
,
"
r
"
)
as
f
:
# We currently export the file as a gzip file so we need to take that into accoutn
with
gzip
.
open
(
settings_filename
,
"
rb
"
)
as
f
:
all_info
=
json
.
loads
(
f
.
read
())
#
...
...
This diff is collapsed.
Click to expand it.
binarycpython/utils/population_extensions/dataIO.py
+
4
−
2
View file @
c90fc078
...
...
@@ -666,14 +666,16 @@ class dataIO:
def
NFS_flush_hack
(
self
,
filename
):
"""
Use opendir()/closedir() to flush NFS access to a file.
NOTE: this may or may not work!
TODO: This function leads to a complaint about unclosed scandir operators. Check if that can be resolved.
"""
os
.
sync
()
dirname
=
os
.
path
.
dirname
(
filename
)
os
.
scandir
(
dirname
)
os
.
scandir
.
close
()
for
_
in
os
.
scandir
(
dirname
):
pass
def
compression_type
(
self
,
filename
):
"""
...
...
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