<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18084">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">selftest/trial_test: Fix repr(RuntimeError) changing in new python version<br><br>If using python 3.8.2, the trailing comma at the end of parameters is<br>not longer there (probably got fixed, since it's not needed). That<br>change breaks expected output.<br><br>Change-Id: I6da3024f946c0e761099058e812c0eacf3d6071f<br>---<br>M selftest/resource_test.ok<br>M selftest/resource_test.py<br>M selftest/trial_test.ok<br>M selftest/trial_test.py<br>4 files changed, 6 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/84/18084/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok</span><br><span>index 08989a2..6147408 100644</span><br><span>--- a/selftest/resource_test.ok</span><br><span>+++ b/selftest/resource_test.ok</span><br><span>@@ -6,7 +6,7 @@</span><br><span> - expect failure to solve:</span><br><span> The requested resource requirements are not solvable [[0, 2], [2], [0, 2]]</span><br><span> - test removing a Resources list from itself</span><br><span style="color: hsl(0, 100%, 40%);">-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.',)</span><br><span style="color: hsl(120, 100%, 40%);">+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.</span><br><span> - test removing a Resources list from one with the same list in it</span><br><span> - test resources config and state dir:</span><br><span> cnf -: DBG: Found config file paths.conf as [PATH]/selftest/conf/paths.conf in ./conf which is [PATH]/selftest/conf</span><br><span>diff --git a/selftest/resource_test.py b/selftest/resource_test.py</span><br><span>index 0b9550e..3f7cd51 100755</span><br><span>--- a/selftest/resource_test.py</span><br><span>+++ b/selftest/resource_test.py</span><br><span>@@ -53,7 +53,7 @@</span><br><span>     r.drop(r)</span><br><span>     assert False</span><br><span> except RuntimeError as e:</span><br><span style="color: hsl(0, 100%, 40%);">-    print('ok, caused exception: %r' % e)</span><br><span style="color: hsl(120, 100%, 40%);">+    print('ok, caused exception RuntimeError: %s' % str(e))</span><br><span> </span><br><span> print('- test removing a Resources list from one with the same list in it')</span><br><span> r = resource.Resources({ 'k': [ {'a': 1, 'b': 2}, {'a': 3, 'b': 4}, ],</span><br><span>diff --git a/selftest/trial_test.ok b/selftest/trial_test.ok</span><br><span>index 6ad39a9..8c6a567 100644</span><br><span>--- a/selftest/trial_test.ok</span><br><span>+++ b/selftest/trial_test.ok</span><br><span>@@ -11,6 +11,6 @@</span><br><span> None</span><br><span> - test checksum verification</span><br><span> - detect wrong checksum</span><br><span style="color: hsl(0, 100%, 40%);">-ok, got RuntimeError("Checksum mismatch for '[PATH]/trial_test/invalid_checksum/file2' vs. '[PATH]/trial_test/invalid_checksum/checksums.md5' line 2",)</span><br><span style="color: hsl(120, 100%, 40%);">+ok, got RuntimeError: Checksum mismatch for '[PATH]/trial_test/invalid_checksum/file2' vs. '[PATH]/trial_test/invalid_checksum/checksums.md5' line 2</span><br><span> - detect missing file</span><br><span style="color: hsl(0, 100%, 40%);">-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",)</span><br><span style="color: hsl(120, 100%, 40%);">+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</span><br><span>diff --git a/selftest/trial_test.py b/selftest/trial_test.py</span><br><span>index 41d71e6..a99428a 100755</span><br><span>--- a/selftest/trial_test.py</span><br><span>+++ b/selftest/trial_test.py</span><br><span>@@ -37,13 +37,13 @@</span><br><span> try:</span><br><span>     t.verify()</span><br><span> except RuntimeError as e:</span><br><span style="color: hsl(0, 100%, 40%);">-    print('ok, got %r' % e)</span><br><span style="color: hsl(120, 100%, 40%);">+    print('ok, got RuntimeError: %s' % str(e))</span><br><span> </span><br><span> print('- detect missing file')</span><br><span> t = Trial(d.child('missing_file'))</span><br><span> try:</span><br><span>     t.verify()</span><br><span> except RuntimeError as e:</span><br><span style="color: hsl(0, 100%, 40%);">-    print('ok, got %r' % e)</span><br><span style="color: hsl(120, 100%, 40%);">+    print('ok, got RuntimeError: %s' % str(e))</span><br><span> </span><br><span> # vim: expandtab tabstop=4 shiftwidth=4</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18084">change 18084</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18084"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gsm-tester </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I6da3024f946c0e761099058e812c0eacf3d6071f </div>
<div style="display:none"> Gerrit-Change-Number: 18084 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>