Skip to content

Commit

Permalink
Merge pull request #209 from Stanowczo/add-qtserialport-support
Browse files Browse the repository at this point in the history
PR: Add support for QtSerialPort add-on
  • Loading branch information
dalthviz authored Aug 24, 2021
2 parents 5883101 + 42c5608 commit ecf1063
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
17 changes: 17 additions & 0 deletions qtpy/QtSerialPort.py
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')
12 changes: 12 additions & 0 deletions qtpy/tests/test_qtserialport.py
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

0 comments on commit ecf1063

Please sign in to comment.