Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
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
FSL
fslpy
Commits
9fff002c
Commit
9fff002c
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Test neverQueue/synchronous
parent
5a5c22be
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_idle.py
+59
-0
59 additions, 0 deletions
tests/test_idle.py
with
59 additions
and
0 deletions
tests/test_idle.py
+
59
−
0
View file @
9fff002c
...
@@ -427,6 +427,65 @@ def test_idle_alwaysQueue4():
...
@@ -427,6 +427,65 @@ def test_idle_alwaysQueue4():
assert
called
[
0
]
assert
called
[
0
]
@pytest.mark.wxtest
def
test_neverQueue
():
_run_with_wx
(
_test_neverQueue
)
def
_test_neverQueue
():
called
=
[
False
]
def
task
():
called
[
0
]
=
True
oldval
=
idle
.
idleLoop
.
neverQueue
try
:
idle
.
idleLoop
.
neverQueue
=
True
idle
.
idle
(
task
)
assert
called
[
0
]
idle
.
idleLoop
.
neverQueue
=
False
called
[
0
]
=
False
idle
.
idle
(
task
)
assert
not
called
[
0
]
_wait_for_idle_loop_to_clear
()
assert
called
[
0
]
finally
:
idle
.
idleLoop
.
neverQueue
=
oldval
@pytest.mark.wxtest
def
test_synchronous
():
_run_with_wx
(
_test_synchronous
)
def
_test_synchronous
():
called
=
[
False
]
def
task
():
called
[
0
]
=
True
def
test_async
():
called
[
0
]
=
False
idle
.
idle
(
task
)
assert
not
called
[
0
]
_wait_for_idle_loop_to_clear
()
assert
called
[
0
]
oldval
=
idle
.
idleLoop
.
neverQueue
try
:
idle
.
idleLoop
.
neverQueue
=
False
test_async
()
with
idle
.
idleLoop
.
synchronous
():
called
[
0
]
=
False
idle
.
idle
(
task
)
assert
called
[
0
]
test_async
()
finally
:
idle
.
idleLoop
.
neverQueue
=
oldval
@pytest.mark.wxtest
@pytest.mark.wxtest
def
test_idle_timeout
():
def
test_idle_timeout
():
...
...
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