diff options
author | Chris Liechti <cliechti@gmx.net> | 2016-10-03 23:09:59 +0200 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2016-10-03 23:09:59 +0200 |
commit | 754914982f37fbea5ecbacb837b651edf443af85 (patch) | |
tree | 4ae3386a61094ffd2a5b1b1c54ce6c87fb8d4fd6 /test | |
parent | e102962247dc3efe7078cad10036608f85562809 (diff) | |
download | pyserial-git-754914982f37fbea5ecbacb837b651edf443af85.tar.gz |
test: skip RS485 tests that only work on real port, #165
Diffstat (limited to 'test')
-rw-r--r-- | test/test_rs485.py | 4 |
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): |