Skip to content

Commit

Permalink
Minor improvements to coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Jun 10, 2016
1 parent f2e0683 commit e5cbe60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qtpy/uic.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ def loadUi(uifile, baseinstance=None, customWidgets=None,
return widget


# The following class is private and only for testing purposes (it is needed by
# test_ui.py)

class _QComboBoxSubclass(QComboBox):
"""
This is a private class that is used only for testing purposes.
"""
pass
6 changes: 6 additions & 0 deletions tests/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@


def get_qapp(icon_path=None):
"""
Helper function to return a QApplication instance
"""
qapp = QtWidgets.QApplication.instance()
if qapp is None:
qapp = QtWidgets.QApplication([''])
return qapp


def test_load_ui():
"""
Make sure that the patched loadUi function behaves as expected
"""
app = get_qapp()
ui = loadUi(os.path.join(os.path.dirname(__file__), 'test.ui'))
assert isinstance(ui.pushButton, QtWidgets.QPushButton)
Expand Down

0 comments on commit e5cbe60

Please sign in to comment.