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
6f16bfa8
Commit
6f16bfa8
authored
3 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
fixed #48
parent
9779f111
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
satella/__init__.py
+1
-1
1 addition, 1 deletion
satella/__init__.py
satella/time/measure.py
+1
-1
1 addition, 1 deletion
satella/time/measure.py
tests/test_time.py
+19
-0
19 additions, 0 deletions
tests/test_time.py
with
22 additions
and
2 deletions
CHANGELOG.md
+
1
−
0
View file @
6f16bfa8
# v2.17.19
*
fixed #49
*
fixed #48
This diff is collapsed.
Click to expand it.
satella/__init__.py
+
1
−
1
View file @
6f16bfa8
__version__
=
'
2.17.19a
2
'
__version__
=
'
2.17.19a
3
'
This diff is collapsed.
Click to expand it.
satella/time/measure.py
+
1
−
1
View file @
6f16bfa8
...
...
@@ -44,7 +44,7 @@ class measure:
>>>
class
Test
:
>>>
@measure
()
>>>
def
measuring
(
self
,
measurement_object
:
measure
):
>>>
def
measuring
(
self
,
measurement_object
:
measure
,
arg1
):
>>>
...
You can also measure how long does executing a future take, eg.
...
...
This diff is collapsed.
Click to expand it.
tests/test_time.py
+
19
−
0
View file @
6f16bfa8
...
...
@@ -13,6 +13,25 @@ from concurrent.futures import Future
class
TestTime
(
unittest
.
TestCase
):
def
test_measure_as_method
(
self
):
self2
=
self
class
MyClass
:
def
__init__
(
self
):
self
.
a
=
1
@measure
()
def
function
(
self
,
v
,
b
):
time
.
sleep
(
1
)
self
.
a
+=
b
self2
.
assertGreaterEqual
(
v
(),
1
)
d
=
MyClass
()
with
measure
()
as
m
:
d
.
function
(
2
)
self
.
assertGreaterEqual
(
m
(),
1
)
self
.
assertEqual
(
d
.
a
,
3
)
def
test_exponential_backoff_grace
(
self
):
eb
=
ExponentialBackoff
(
grace_amount
=
2
)
self
.
assertTrue
(
eb
.
available
)
...
...
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