-
-
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.
Merge pull request #209 from Stanowczo/add-qtserialport-support
PR: Add support for QtSerialPort add-on
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# -*- coding: utf-8 -*- | ||
# ----------------------------------------------------------------------------- | ||
# Copyright © 2020 Marcin Stano | ||
# Copyright © 2009- The Spyder Development Team | ||
# | ||
# Licensed under the terms of the MIT License | ||
# (see LICENSE.txt for details) | ||
# ----------------------------------------------------------------------------- | ||
"""Provides QtSerialPort classes and functions.""" | ||
|
||
# Local imports | ||
from . import PYQT5, PythonQtError | ||
|
||
if PYQT5: | ||
from PyQt5.QtSerialPort import * | ||
else: | ||
raise PythonQtError('No Qt bindings could be found') |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from __future__ import absolute_import | ||
|
||
import pytest | ||
from qtpy import PYQT5 | ||
|
||
@pytest.mark.skipif(not PYQT5, reason="Only available in Qt5 bindings, but still not in PySide2") | ||
def test_qtserialport(): | ||
"""Test the qtpy.QtSerialPort namespace""" | ||
from qtpy import QtSerialPort | ||
|
||
assert QtSerialPort.QSerialPort is not None | ||
assert QtSerialPort.QSerialPortInfo is not None |