Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pipelines
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.pipelines
Commits
70e46451
Commit
70e46451
authored
2 years ago
by
Yannick DAYER
Browse files
Options
Downloads
Patches
Plain Diff
[doc] Fix the confusing check_parameters docstring
parent
360d4c13
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!105
[utils.py] changed return type in check_parameters_for_validity to ensure that a list is returned
Pipeline
#67549
passed
2 years ago
Stage: qa
Stage: test
Stage: doc
Stage: dist
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/bob/pipelines/utils.py
+1
-1
1 addition, 1 deletion
src/bob/pipelines/utils.py
tests/test_utils.py
+9
-0
9 additions, 0 deletions
tests/test_utils.py
with
10 additions
and
1 deletion
src/bob/pipelines/utils.py
+
1
−
1
View file @
70e46451
...
...
@@ -86,7 +86,7 @@ def check_parameters_for_validity(
"""
Checks the given parameters for validity.
Checks a given parameter is in the set of valid parameters. It also
assures that the parameters form a
tuple or a
list. If parameters is
assures that the
returned
parameters form a list. If parameters is
'
None
'
or empty, the default_parameters will be returned (if
default_parameters is omitted, all valid_parameters are returned).
...
...
This diff is collapsed.
Click to expand it.
tests/test_utils.py
+
9
−
0
View file @
70e46451
...
...
@@ -235,6 +235,15 @@ def test_check_parameters_validity():
==
f
"
Invalid
{
desc_str
}
'
{
param
[
1
]
}
'
. Valid values are
{
valid_values
}
, or lists/tuples of those
"
)
# Empty default parameter
param
=
None
default
=
None
retval
=
check_parameters_for_validity
(
param
,
desc_str
,
valid_values
,
default
)
assert
type
(
retval
)
is
list
assert
retval
==
valid_values
# Invalid default parameter
param
=
None
default
=
"
false
"
...
...
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