aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-12-09 14:41:14 +0100
committerOliver Smith <osmith@sysmocom.de>2019-12-11 12:28:40 +0100
commit934caf1a816abe8bbd35d20cf4de442ad6da3e50 (patch)
treedf2227f3ab5201b13b77d0fe1c470c837010bd22 /tests
parentb0ba927e337987bb78f318f1866b08c98f1b91ed (diff)
Drop python2 support (again)
Re-apply reverted commit Iabda95073faa2191fd117e9637e0858c589e9d9e ("Drop python2 support"), but with additional changes to make the scripts actually work with python3 and to make it build without python2. I have verified, that the contrib/jenkins.sh scripts of all Osmocom repositories (with their python3 patches on top) are working with this patch and that all Osmocom repositories with the python3 patches build in OBS (tested in own namespace). All related patches for changing from python2 to 3 in other repositories must be merged shortly after this one, as soon as the build slaves were (automatically) updated to have the new osmo-python-tests installed: https://gerrit.osmocom.org/q/topic:drop-py2 New fixes: * osmopy/obscvty.py: verify: fix compare Comparing maps in python3 does not work the same as in python2. Convert them to lists first, so the compare works as intended again. Fix error: File "/home/user/code/osmo-dev/src/osmo-python-tests/scripts/osmotestvty.py", line 57, in test_history assert(self.vty.w_verify(test_str, [t1])) AssertionError * osmopy/obscvty.py: use enc/dec with send/recv Fix error: self.socket.send("%s\r" % request) TypeError: a bytes-like object is required, not 'str' * scripts/osmotestconfig.py: use encode() before writing to file Fix error: File "/home/user/code/osmo-dev/src/osmo-python-tests/scripts/osmotestconfig.py", line 91, in copy_config tmpfile.write(open(config).read()) File "/usr/lib/python3.5/tempfile.py", line 622, in func_wrapper return func(*args, **kwargs) TypeError: a bytes-like object is required, not 'str' * debian/control: add --buildsystem=pybuild. Otherwise "--with python3" is ignored and the build fails if python2 is not installed, with: Can't exec "pyversions": No such file or directory at /usr/[...]/python_distutils.pm line 120. Related: OS#2819 Change-Id: I3ffc3519bf6c22536a49dad7a966188ddad351a7
Diffstat (limited to 'tests')
-rw-r--r--tests/test_py2.py7
1 files changed, 0 insertions, 7 deletions
diff --git a/tests/test_py2.py b/tests/test_py2.py
deleted file mode 100644
index cac5261..0000000
--- a/tests/test_py2.py
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env python2
-
-# just import a smoke test for osmopy
-
-import osmopy
-
-print '[Python2] Smoke test PASSED.'