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
184f2938
Commit
184f2938
authored
4 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Adjust idle unit test
parent
c4a3d769
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
+10
-4
10 additions, 4 deletions
tests/test_idle.py
with
10 additions
and
4 deletions
tests/test_idle.py
+
10
−
4
View file @
184f2938
...
...
@@ -38,6 +38,11 @@ def _run_with_wx(func, *args, **kwargs):
if
callAfterApp
is
not
None
:
callAfterApp
()
# canHaveGui caches its return val,
# so clear it otherwise we may
# affect subsequent tests
idle
.
_canHaveGui
.
cache_clear
()
def
wrap
():
try
:
...
...
@@ -64,6 +69,8 @@ def _run_with_wx(func, *args, **kwargs):
idle
.
idleLoop
.
reset
()
idle
.
_canHaveGui
.
cache_clear
()
if
raised
[
0
]
and
propagateRaise
:
raise
raised
[
0
]
...
...
@@ -413,10 +420,9 @@ def test_idle_alwaysQueue4():
import
fsl.utils.platform
with
mock
.
patch
.
dict
(
'
sys.modules
'
,
{
'
wx
'
:
None
}):
# idle uses the platform module to
# determine whether a GUI is available,
# so we have to reload it
reload_module
(
fsl
.
utils
.
platform
)
# The idle._canHaveGui caches its result,
# so we need to invalidate it
idle
.
_canHaveGui
.
cache_clear
()
idle
.
idle
(
task
,
alwaysQueue
=
True
)
with
pytest
.
raises
(
ImportError
):
...
...
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