From 00722b1b8810ac38bfb47e8c49437055b600dfff Mon Sep 17 00:00:00 2001 From: Matt Hanley Date: Thu, 14 Sep 2023 14:37:15 +0000 Subject: [PATCH 1/3] fix: update regex --- vxi11/vxi11.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vxi11/vxi11.py b/vxi11/vxi11.py index 231582d..c7f4221 100644 --- a/vxi11/vxi11.py +++ b/vxi11/vxi11.py @@ -131,8 +131,8 @@ def parse_visa_resource_string(resource_string): # TCPIP0::10.0.0.1::gpib,5::INSTR # TCPIP0::10.0.0.1::usb0::INSTR # TCPIP0::10.0.0.1::usb0[1234::5678::MYSERIAL::0]::INSTR - m = re.match('^(?P(?PTCPIP)\d*)(::(?P[^\s:]+))' - '(::(?P[^\s:]+(\[.+\])?))?(::(?PINSTR))$', + m = re.match(r'^(?P(?PTCPIP)\d*)(::(?P[^\s:]+))' + r'(::(?P[^\s:]+(\[.+\])?))?(::(?PINSTR))$', resource_string, re.I) if m is not None: From a8ad324d645d6f7215f207f2cc2988dc49859698 Mon Sep 17 00:00:00 2001 From: Matt Hanley Date: Thu, 14 Sep 2023 14:37:31 +0000 Subject: [PATCH 2/3] fix: remove dependency on nose --- tests/test_vxi11.py | 58 ++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/tests/test_vxi11.py b/tests/test_vxi11.py index 84f1dcc..7a338d1 100644 --- a/tests/test_vxi11.py +++ b/tests/test_vxi11.py @@ -1,48 +1,46 @@ #!/usr/bin/env python -import nose -from nose.tools import eq_ from vxi11.vxi11 import parse_visa_resource_string + def test_parse_visa_resource_string(): f = parse_visa_resource_string res = f('TCPIP::10.0.0.1::INSTR') - eq_(res['type'], 'TCPIP') - eq_(res['prefix'], 'TCPIP') - eq_(res['arg1'], '10.0.0.1') - eq_(res['suffix'], 'INSTR') + assert res['type'] == 'TCPIP' + assert res['prefix'] == 'TCPIP' + assert res['arg1'] == '10.0.0.1' + assert res['suffix'] == 'INSTR' res = f('TCPIP0::10.0.0.1::INSTR') - eq_(res['type'], 'TCPIP') - eq_(res['prefix'], 'TCPIP0') - eq_(res['arg1'], '10.0.0.1') - eq_(res['suffix'], 'INSTR') + assert res['type'] == 'TCPIP' + assert res['prefix'] == 'TCPIP0' + assert res['arg1'] == '10.0.0.1' + assert res['suffix'] == 'INSTR' res = f('TCPIP::10.0.0.1::gpib,5::INSTR') - eq_(res['type'], 'TCPIP') - eq_(res['prefix'], 'TCPIP') - eq_(res['arg1'], '10.0.0.1') - eq_(res['suffix'], 'INSTR') + assert res['type'] == 'TCPIP' + assert res['prefix'] == 'TCPIP' + assert res['arg1'] == '10.0.0.1' + assert res['suffix'] == 'INSTR' res = f('TCPIP0::10.0.0.1::gpib,5::INSTR') - eq_(res['type'], 'TCPIP') - eq_(res['prefix'], 'TCPIP0') - eq_(res['arg1'], '10.0.0.1') - eq_(res['arg2'], 'gpib,5') - eq_(res['suffix'], 'INSTR') + assert res['type'] == 'TCPIP' + assert res['prefix'] == 'TCPIP0' + assert res['arg1'] == '10.0.0.1' + assert res['arg2'] == 'gpib,5' + assert res['suffix'] == 'INSTR' res = f('TCPIP0::10.0.0.1::usb0::INSTR') - eq_(res['type'], 'TCPIP') - eq_(res['prefix'], 'TCPIP0') - eq_(res['arg1'], '10.0.0.1') - eq_(res['arg2'], 'usb0') - eq_(res['suffix'], 'INSTR') + assert res['type'] == 'TCPIP' + assert res['prefix'] == 'TCPIP0' + assert res['arg1'] == '10.0.0.1' + assert res['arg2'] == 'usb0' + assert res['suffix'] == 'INSTR' res = f('TCPIP0::10.0.0.1::usb0[1234::5678::MYSERIAL::0]::INSTR') - eq_(res['type'], 'TCPIP') - eq_(res['prefix'], 'TCPIP0') - eq_(res['arg1'], '10.0.0.1') - eq_(res['arg2'], 'usb0[1234::5678::MYSERIAL::0]') - eq_(res['suffix'], 'INSTR') - + assert res['type'] == 'TCPIP' + assert res['prefix'] == 'TCPIP0' + assert res['arg1'] == '10.0.0.1' + assert res['arg2'] == 'usb0[1234::5678::MYSERIAL::0]' + assert res['suffix'] == 'INSTR' From 2ffdfd5348c51189418de4a18f65eb7190d2a5a5 Mon Sep 17 00:00:00 2001 From: matt-loft <129417398+matt-loft@users.noreply.github.com> Date: Thu, 14 Sep 2023 09:08:13 -0600 Subject: [PATCH 3/3] chore: bump version --- vxi11/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vxi11/version.py b/vxi11/version.py index e46aee1..8969d49 100644 --- a/vxi11/version.py +++ b/vxi11/version.py @@ -1 +1 @@ -__version__ = '0.9' +__version__ = '0.9.1'