Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.measure
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
bob
bob.measure
Commits
b349ddaf
There was a problem fetching the pipeline summary.
Commit
b349ddaf
authored
7 years ago
by
Theophile GENTILHOMME
Browse files
Options
Downloads
Patches
Plain Diff
ensure tests pass with python2.7
parent
40332754
No related branches found
No related tags found
2 merge requests
!54
Refactors the score loading and scripts functionality
,
!52
generic plotting script for bob measure
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/measure/test_script.py
+9
-2
9 additions, 2 deletions
bob/measure/test_script.py
with
9 additions
and
2 deletions
bob/measure/test_script.py
+
9
−
2
View file @
b349ddaf
'''
Tests for bob.measure scripts
'''
'''
Tests for bob.measure scripts
'''
import
sys
import
os
import
os
import
filecmp
import
filecmp
import
tempfile
import
tempfile
...
@@ -17,7 +18,10 @@ def test_metrics():
...
@@ -17,7 +18,10 @@ def test_metrics():
with
open
(
'
tmp
'
,
'
w
'
)
as
f
:
with
open
(
'
tmp
'
,
'
w
'
)
as
f
:
f
.
write
(
result
.
output
)
f
.
write
(
result
.
output
)
test_ref
=
bob
.
io
.
base
.
test_utils
.
datafile
(
'
test_m1.txt
'
,
'
bob.measure
'
)
test_ref
=
bob
.
io
.
base
.
test_utils
.
datafile
(
'
test_m1.txt
'
,
'
bob.measure
'
)
assert
filecmp
.
cmp
(
test_ref
,
'
tmp
'
)
assert
result
.
exit_code
==
0
#reference case has been generated using python 3.6
if
sys
.
version_info
>=
(
3
,
6
):
assert
filecmp
.
cmp
(
test_ref
,
'
tmp
'
)
dev2
=
bob
.
io
.
base
.
test_utils
.
datafile
(
'
dev-2.txt
'
,
'
bob.measure
'
)
dev2
=
bob
.
io
.
base
.
test_utils
.
datafile
(
'
dev-2.txt
'
,
'
bob.measure
'
)
test1
=
bob
.
io
.
base
.
test_utils
.
datafile
(
'
test-1.txt
'
,
'
bob.measure
'
)
test1
=
bob
.
io
.
base
.
test_utils
.
datafile
(
'
test-1.txt
'
,
'
bob.measure
'
)
...
@@ -29,7 +33,10 @@ def test_metrics():
...
@@ -29,7 +33,10 @@ def test_metrics():
with
open
(
'
tmp
'
,
'
w
'
)
as
f
:
with
open
(
'
tmp
'
,
'
w
'
)
as
f
:
f
.
write
(
result
.
output
)
f
.
write
(
result
.
output
)
test_ref
=
bob
.
io
.
base
.
test_utils
.
datafile
(
'
test_m2.txt
'
,
'
bob.measure
'
)
test_ref
=
bob
.
io
.
base
.
test_utils
.
datafile
(
'
test_m2.txt
'
,
'
bob.measure
'
)
assert
filecmp
.
cmp
(
test_ref
,
'
tmp
'
)
assert
result
.
exit_code
==
0
#reference case has been generated using python 3.6
if
sys
.
version_info
>=
(
3
,
6
):
assert
filecmp
.
cmp
(
test_ref
,
'
tmp
'
)
with
runner
.
isolated_filesystem
():
with
runner
.
isolated_filesystem
():
result
=
runner
.
invoke
(
result
=
runner
.
invoke
(
...
...
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