Use QWebView/QWebEngineView for test_tab
This commit is contained in:
parent
5b9ae8bc85
commit
0c1e266073
@ -17,13 +17,26 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from qutebrowser.browser import tab
|
from qutebrowser.browser import tab
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QWidget
|
try:
|
||||||
|
from PyQt5.QtWebKitWidgets import QWebView
|
||||||
|
except ImportError:
|
||||||
|
QWebView = None
|
||||||
|
|
||||||
|
try:
|
||||||
|
from PyQt5.QtWebEngineWidgets import QWebEngineView
|
||||||
|
except ImportError:
|
||||||
|
QWebEngineView = None
|
||||||
|
|
||||||
|
|
||||||
def test_tab(qtbot):
|
@pytest.mark.parametrize('view', [QWebView, QWebEngineView])
|
||||||
w = QWidget()
|
def test_tab(qtbot, view):
|
||||||
|
if view is None:
|
||||||
|
pytest.skip("View not available")
|
||||||
|
w = view()
|
||||||
qtbot.add_widget(w)
|
qtbot.add_widget(w)
|
||||||
tab_w = tab.AbstractTab()
|
tab_w = tab.AbstractTab()
|
||||||
tab_w.show()
|
tab_w.show()
|
||||||
|
Loading…
Reference in New Issue
Block a user