Change in osmo-gsm-tester[master]: selftest/trial_test: Fix repr(RuntimeError) changing in new python ve...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Wed May 6 15:44:11 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18084 )


Change subject: selftest/trial_test: Fix repr(RuntimeError) changing in new python version
......................................................................

selftest/trial_test: Fix repr(RuntimeError) changing in new python version

If using python 3.8.2, the trailing comma at the end of parameters is
not longer there (probably got fixed, since it's not needed). That
change breaks expected output.

Change-Id: I6da3024f946c0e761099058e812c0eacf3d6071f
---
M selftest/resource_test.ok
M selftest/resource_test.py
M selftest/trial_test.ok
M selftest/trial_test.py
4 files changed, 6 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/84/18084/1

diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok
index 08989a2..6147408 100644
--- a/selftest/resource_test.ok
+++ b/selftest/resource_test.ok
@@ -6,7 +6,7 @@
 - expect failure to solve:
 The requested resource requirements are not solvable [[0, 2], [2], [0, 2]]
 - test removing a Resources list from itself
-ok, caused exception: RuntimeError('Refusing to drop a list of resources from itself. This is probably a bug where a list of Resources() should have been copied but is passed as-is. use Resources.clear() instead.',)
+ok, caused exception RuntimeError: Refusing to drop a list of resources from itself. This is probably a bug where a list of Resources() should have been copied but is passed as-is. use Resources.clear() instead.
 - test removing a Resources list from one with the same list in it
 - test resources config and state dir:
 cnf -: DBG: Found config file paths.conf as [PATH]/selftest/conf/paths.conf in ./conf which is [PATH]/selftest/conf
diff --git a/selftest/resource_test.py b/selftest/resource_test.py
index 0b9550e..3f7cd51 100755
--- a/selftest/resource_test.py
+++ b/selftest/resource_test.py
@@ -53,7 +53,7 @@
     r.drop(r)
     assert False
 except RuntimeError as e:
-    print('ok, caused exception: %r' % e)
+    print('ok, caused exception RuntimeError: %s' % str(e))
 
 print('- test removing a Resources list from one with the same list in it')
 r = resource.Resources({ 'k': [ {'a': 1, 'b': 2}, {'a': 3, 'b': 4}, ],
diff --git a/selftest/trial_test.ok b/selftest/trial_test.ok
index 6ad39a9..8c6a567 100644
--- a/selftest/trial_test.ok
+++ b/selftest/trial_test.ok
@@ -11,6 +11,6 @@
 None
 - test checksum verification
 - detect wrong checksum
-ok, got RuntimeError("Checksum mismatch for '[PATH]/trial_test/invalid_checksum/file2' vs. '[PATH]/trial_test/invalid_checksum/checksums.md5' line 2",)
+ok, got RuntimeError: Checksum mismatch for '[PATH]/trial_test/invalid_checksum/file2' vs. '[PATH]/trial_test/invalid_checksum/checksums.md5' line 2
 - detect missing file
-ok, got RuntimeError("File listed in checksums file but missing in trials dir: '[PATH]/trial_test/missing_file/file2' vs. '[PATH]/trial_test/missing_file/checksums.md5' line 2",)
+ok, got RuntimeError: File listed in checksums file but missing in trials dir: '[PATH]/trial_test/missing_file/file2' vs. '[PATH]/trial_test/missing_file/checksums.md5' line 2
diff --git a/selftest/trial_test.py b/selftest/trial_test.py
index 41d71e6..a99428a 100755
--- a/selftest/trial_test.py
+++ b/selftest/trial_test.py
@@ -37,13 +37,13 @@
 try:
     t.verify()
 except RuntimeError as e:
-    print('ok, got %r' % e)
+    print('ok, got RuntimeError: %s' % str(e))
 
 print('- detect missing file')
 t = Trial(d.child('missing_file'))
 try:
     t.verify()
 except RuntimeError as e:
-    print('ok, got %r' % e)
+    print('ok, got RuntimeError: %s' % str(e))
 
 # vim: expandtab tabstop=4 shiftwidth=4

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18084
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I6da3024f946c0e761099058e812c0eacf3d6071f
Gerrit-Change-Number: 18084
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200506/1c3cab09/attachment.htm>


More information about the gerrit-log mailing list