Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
deepdraw
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
Model registry
Operate
Environments
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
medai
software
deepdraw
Commits
b40d44e2
Commit
b40d44e2
authored
4 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[test.test_cli] Simplify assertions and benefit from pytest introspection
parent
202fb552
No related branches found
No related tags found
1 merge request
!16
Use pytest instead of nose
Pipeline
#45824
failed
4 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/ip/binseg/test/test_cli.py
+6
-32
6 additions, 32 deletions
bob/ip/binseg/test/test_cli.py
with
6 additions
and
32 deletions
bob/ip/binseg/test/test_cli.py
+
6
−
32
View file @
b40d44e2
...
...
@@ -215,11 +215,7 @@ def _check_experiment_stare(caplog, overlay):
}
messages
=
"
\n
"
.
join
([
k
.
getMessage
()
for
k
in
caplog
.
records
])
for
k
,
v
in
keywords
.
items
():
assert
_str_counter
(
k
,
messages
)
==
v
,
(
f
"
Count for string
'
{
k
}
'
appeared
"
f
"
(
{
_str_counter
(
k
,
logging_output
)
}
)
"
f
"
instead of the expected
{
v
}
"
)
assert
_str_counter
(
k
,
messages
)
==
v
def
test_experiment_stare_with_overlay
(
caplog
):
...
...
@@ -283,11 +279,7 @@ def _check_train(caplog, runner):
messages
=
"
\n
"
.
join
([
k
.
getMessage
()
for
k
in
caplog
.
records
])
for
k
,
v
in
keywords
.
items
():
assert
_str_counter
(
k
,
messages
)
==
v
,
(
f
"
Count for string
'
{
k
}
'
appeared
"
f
"
(
{
_str_counter
(
k
,
logging_output
)
}
)
"
f
"
instead of the expected
{
v
}
"
)
assert
_str_counter
(
k
,
messages
)
==
v
def
_check_predict
(
caplog
,
runner
):
...
...
@@ -340,11 +332,7 @@ def _check_predict(caplog, runner):
messages
=
"
\n
"
.
join
([
k
.
getMessage
()
for
k
in
caplog
.
records
])
for
k
,
v
in
keywords
.
items
():
assert
_str_counter
(
k
,
messages
)
==
v
,
(
f
"
Count for string
'
{
k
}
'
appeared
"
f
"
(
{
_str_counter
(
k
,
logging_output
)
}
)
"
f
"
instead of the expected
{
v
}
"
)
assert
_str_counter
(
k
,
messages
)
==
v
def
_check_evaluate
(
caplog
,
runner
):
...
...
@@ -402,20 +390,14 @@ def _check_evaluate(caplog, runner):
assert
len
(
fnmatch
.
filter
(
os
.
listdir
(
basedir
),
"
*.png
"
))
==
10
keywords
=
{
r
"
^Started evaluation$
"
:
1
,
r
"
^Maximum F1-score of.*\(chosen \*a posteriori\*\)$
"
:
3
,
r
"
^F1-score of.*\(chosen \*a priori\*\)$
"
:
2
,
r
"
^F1-score of.*\(second annotator; threshold=0.5\)$
"
:
2
,
r
"
^Ended evaluation$
"
:
1
,
}
messages
=
"
\n
"
.
join
([
k
.
getMessage
()
for
k
in
caplog
.
records
])
for
k
,
v
in
keywords
.
items
():
assert
_str_counter
(
k
,
messages
)
==
v
,
(
f
"
Count for string
'
{
k
}
'
appeared
"
f
"
(
{
_str_counter
(
k
,
logging_output
)
}
)
"
f
"
instead of the expected
{
v
}
"
)
assert
_str_counter
(
k
,
messages
)
==
v
def
_check_compare
(
caplog
,
runner
):
...
...
@@ -451,11 +433,7 @@ def _check_compare(caplog, runner):
}
messages
=
"
\n
"
.
join
([
k
.
getMessage
()
for
k
in
caplog
.
records
])
for
k
,
v
in
keywords
.
items
():
assert
_str_counter
(
k
,
messages
)
==
v
,
(
f
"
Count for string
'
{
k
}
'
appeared
"
f
"
(
{
_str_counter
(
k
,
logging_output
)
}
)
"
f
"
instead of the expected
{
v
}
"
)
assert
_str_counter
(
k
,
messages
)
==
v
def
_check_significance
(
caplog
,
runner
):
...
...
@@ -513,11 +491,7 @@ def _check_significance(caplog, runner):
}
messages
=
"
\n
"
.
join
([
k
.
getMessage
()
for
k
in
caplog
.
records
])
for
k
,
v
in
keywords
.
items
():
assert
_str_counter
(
k
,
messages
)
==
v
,
(
f
"
Count for string
'
{
k
}
'
appeared
"
f
"
(
{
_str_counter
(
k
,
logging_output
)
}
)
"
f
"
instead of the expected
{
v
}
"
)
assert
_str_counter
(
k
,
messages
)
==
v
def
test_discrete_experiment_stare
(
caplog
):
...
...
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