Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
c64b731c
Commit
c64b731c
authored
7 months ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
v2.26.4
parent
e0d3f7d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#64185
canceled with stages
in 1 minute and 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
satella/coding/generators.py
+1
-1
1 addition, 1 deletion
satella/coding/generators.py
tests/test_coding/test_iterators.py
+4
-5
4 additions, 5 deletions
tests/test_coding/test_iterators.py
with
5 additions
and
6 deletions
satella/coding/generators.py
+
1
−
1
View file @
c64b731c
...
...
@@ -76,7 +76,7 @@ class RunActionAfterGeneratorCompletes(tp.Generator, metaclass=ABCMeta):
"""
This will run when this generator throws any exception. Override it.
"""
def
run_when_generator_completes
(
gen
:
tp
.
Generator
,
call_on_done
:
tp
.
Callable
def
run_when_generator_completes
(
gen
:
tp
.
Generator
,
call_on_done
:
tp
.
Callable
,
*
args
,
**
kwargs
)
->
RunActionAfterGeneratorCompletes
:
"""
Return the generator with call_on_done to be called on when it finishes
...
...
This diff is collapsed.
Click to expand it.
tests/test_coding/test_iterators.py
+
4
−
5
View file @
c64b731c
...
...
@@ -140,7 +140,7 @@ class TestIterators(unittest.TestCase):
self
.
assertFalse
(
called
)
def
test_run_when_generator_
closed_
failure
(
self
):
def
test_run_when_generator_failure
(
self
):
called
=
False
def
generator
():
...
...
@@ -161,10 +161,9 @@ class TestIterators(unittest.TestCase):
called
=
True
gen
=
Inner
(
generator
())
a
=
next
(
gen
)
gen
.
close
()
self
.
assertRaises
(
StopIteration
,
next
,
gen
)
self
.
assertFalse
(
called
)
for
i
in
gen
:
pass
self
.
assertTrue
(
called
)
def
test_list_wrapper_iterator_contains
(
self
):
...
...
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