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
This commit is contained in:
Pau Espin 2020-05-06 17:29:50 +02:00
parent eaefe6b533
commit afa2fc3aa6
4 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -53,7 +53,7 @@ try:
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}, ],

View File

@ -11,6 +11,6 @@ third
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

View File

@ -37,13 +37,13 @@ t = Trial(d.child('invalid_checksum'))
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