-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Raise warnings when importing QtHelp or QtMultimedia with PySide2
- Loading branch information
Showing
5 changed files
with
46 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
from __future__ import absolute_import | ||
|
||
import pytest | ||
from qtpy import PYSIDE2, QtMultimedia | ||
import warnings | ||
from qtpy import PYSIDE2, PythonQtWarning | ||
|
||
|
||
@pytest.mark.skipif(PYSIDE2, reason="It fails on PySide2") | ||
def test_qtmultimedia(): | ||
"""Test the qtpy.QtMultimedia namespace""" | ||
from qtpy import QtMultimedia | ||
|
||
assert QtMultimedia.QAbstractVideoBuffer is not None | ||
assert QtMultimedia.QAudio is not None | ||
assert QtMultimedia.QAudioDeviceInfo is not None | ||
assert QtMultimedia.QAudioInput is not None | ||
assert QtMultimedia.QSound is not None | ||
|
||
|
||
@pytest.mark.skipif(not PYSIDE2, reason="Only runs in not implemented bindings") | ||
def test_qtmultimedia_not_implemented(): | ||
with warnings.catch_warnings(record=True) as w: | ||
# Cause all warnings to always be triggered. | ||
warnings.simplefilter("always") | ||
# Try to import QtMultimedia. | ||
from qtpy import QtMultimedia | ||
|
||
assert len(w) == 1 | ||
assert issubclass(w[-1].category, PythonQtWarning) | ||
assert "missing" in str(w[-1].message) |