summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liechti <cliechti@gmx.net>2016-10-03 23:09:59 +0200
committerChris Liechti <cliechti@gmx.net>2016-10-03 23:09:59 +0200
commit754914982f37fbea5ecbacb837b651edf443af85 (patch)
tree4ae3386a61094ffd2a5b1b1c54ce6c87fb8d4fd6
parente102962247dc3efe7078cad10036608f85562809 (diff)
downloadpyserial-git-754914982f37fbea5ecbacb837b651edf443af85.tar.gz
test: skip RS485 tests that only work on real port, #165
-rw-r--r--test/test_rs485.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test_rs485.py b/test/test_rs485.py
index 153b345..e918f67 100644
--- a/test/test_rs485.py
+++ b/test/test_rs485.py
@@ -13,7 +13,7 @@ import serial
import serial.rs485
# on which port should the tests be performed:
-PORT = 0
+PORT = 'loop://'
class Test_RS485_settings(unittest.TestCase):
@@ -43,6 +43,8 @@ class Test_RS485_class(unittest.TestCase):
"""Test RS485 class"""
def setUp(self):
+ if not isinstance(serial.serial_for_url(PORT), serial.Serial):
+ raise unittest.SkipTest("RS485 test only compatible with real serial port")
self.s = serial.rs485.RS485(PORT, timeout=1)
def tearDown(self):