Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sift
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SIFT
sift
Commits
d29ea9f8
Verified
Commit
d29ea9f8
authored
5 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests to explicitly create application objects
parent
ca3c6812
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
uwsift/__main__.py
+10
-5
10 additions, 5 deletions
uwsift/__main__.py
uwsift/tests/conftest.py
+2
-1
2 additions, 1 deletion
uwsift/tests/conftest.py
with
12 additions
and
6 deletions
uwsift/__main__.py
+
10
−
5
View file @
d29ea9f8
...
...
@@ -1128,6 +1128,15 @@ def _search_paths(arglist):
yield
subpath
def
create_app
()
->
(
app
.
Application
,
QtWidgets
.
QApplication
):
QtWidgets
.
QApplication
.
setAttribute
(
QtCore
.
Qt
.
AA_EnableHighDpiScaling
)
vispy_app
=
app
.
use_app
(
'
pyqt5
'
)
qt_app
=
vispy_app
.
create
()
if
hasattr
(
QtWidgets
.
QStyleFactory
,
'
AA_UseHighDpiPixmaps
'
):
qt_app
.
setAttribute
(
QtCore
.
Qt
.
AA_UseHighDpiPixmaps
)
return
vispy_app
,
qt_app
def
main
():
import
argparse
parser
=
argparse
.
ArgumentParser
(
description
=
"
Run SIFT
"
)
...
...
@@ -1171,11 +1180,7 @@ def main():
LOG
.
info
(
"
Using configuration directory: %s
"
,
args
.
config_dir
)
LOG
.
info
(
"
Using cache directory: %s
"
,
args
.
cache_dir
)
QtWidgets
.
QApplication
.
setAttribute
(
QtCore
.
Qt
.
AA_EnableHighDpiScaling
)
vispy_app
=
app
.
use_app
(
'
pyqt5
'
)
qt_app
=
vispy_app
.
create
()
if
hasattr
(
QtWidgets
.
QStyleFactory
,
'
AA_UseHighDpiPixmaps
'
):
qt_app
.
setAttribute
(
QtCore
.
Qt
.
AA_UseHighDpiPixmaps
)
vispy_app
,
qt_app
=
create_app
()
# Add our own fonts to Qt windowing system
font_pattern
=
os
.
path
.
join
(
get_package_data_dir
(),
'
fonts
'
,
'
*
'
)
...
...
This diff is collapsed.
Click to expand it.
uwsift/tests/conftest.py
+
2
−
1
View file @
d29ea9f8
import
pytest
from
uwsift.__main__
import
Main
from
uwsift.__main__
import
Main
,
create_app
from
uwsift.util.default_paths
import
USER_CONFIG_DIR
from
PyQt5.QtTest
import
QTest
...
...
@@ -7,6 +7,7 @@ from PyQt5.QtTest import QTest
@pytest.fixture
(
scope
=
"
session
"
)
def
window
(
tmp_path_factory
):
"""
Provides the SIFT GUI to tests.
"""
vispy_app
,
qt_app
=
create_app
()
# noqa
d
=
tmp_path_factory
.
mktemp
(
"
tmp
"
)
window
=
Main
(
config_dir
=
USER_CONFIG_DIR
,
workspace_dir
=
str
(
d
))
window
.
show
()
...
...
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