aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2020-01-25 22:18:16 +0100
committerSebastian Pipping <sping@gentoo.org>2020-01-25 23:41:54 +0100
commit072f84374cad2ff4347474d1edf05a5dff44970e (patch)
treef6e997087a94b14933ecde9862877408e76e6495
parentMass-apply 2to3 (diff)
downloadmetagen-072f84374cad2ff4347474d1edf05a5dff44970e.tar.gz
metagen-072f84374cad2ff4347474d1edf05a5dff44970e.tar.bz2
metagen-072f84374cad2ff4347474d1edf05a5dff44970e.zip
metagenerator.py: Fix execution of tests for Python 3
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
-rwxr-xr-xmetagen/metagenerator.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/metagen/metagenerator.py b/metagen/metagenerator.py
index 87bd0f6..fd00caa 100755
--- a/metagen/metagenerator.py
+++ b/metagen/metagenerator.py
@@ -49,14 +49,14 @@ class MyMetadata(jaxml.XML_document):
self.longdescription(longdesc)
def do_tests():
- from . import meta_unittest
+ from metagen import meta_unittest
fails = 0
for func in dir(meta_unittest):
if func[0:4] == "test":
try:
- exec("print meta_unittest.%s.__name__ + ':'," % func)
- exec("print meta_unittest.%s.__doc__" % func)
- exec("print meta_unittest.%s()" % func)
+ exec("print(meta_unittest.%s.__name__ + ':', end='')" % func)
+ exec("print(meta_unittest.%s.__doc__)" % func)
+ exec("print(meta_unittest.%s())" % func)
except:
fails += 1
print("Test %s failed:" % func)