Suppress extraneous output in unit tests
This commit is contained in:
parent
60ab0a01bf
commit
2e2e6c88a4
@ -35,10 +35,10 @@ TEST_DIR = os.path.abspath(os.path.join(DATA_DIR, "tests"))
|
|||||||
|
|
||||||
def call(*args):
|
def call(*args):
|
||||||
""" Call Gramps to perform the action with out and err captured """
|
""" Call Gramps to perform the action with out and err captured """
|
||||||
print("call:", args)
|
#print("call:", args)
|
||||||
gramps = Gramps(user=User())
|
gramps = Gramps(user=User())
|
||||||
out, err = gramps.run(*args)
|
out, err = gramps.run(*args)
|
||||||
print("out:", out, "err:", err)
|
#print("out:", out, "err:", err)
|
||||||
return out, err
|
return out, err
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ import shutil
|
|||||||
|
|
||||||
from gramps.test.test_util import Gramps
|
from gramps.test.test_util import Gramps
|
||||||
from gramps.gen.db.utils import open_database
|
from gramps.gen.db.utils import open_database
|
||||||
|
from gramps.gen.user import User
|
||||||
|
|
||||||
ddir = os.path.dirname(__file__)
|
ddir = os.path.dirname(__file__)
|
||||||
example = os.path.join(ddir, "..", "..", "..",
|
example = os.path.join(ddir, "..", "..", "..",
|
||||||
@ -40,10 +41,10 @@ class ReportControl:
|
|||||||
out, err = self.call("-y", "--remove", TREE_NAME + "_import_gedcom")
|
out, err = self.call("-y", "--remove", TREE_NAME + "_import_gedcom")
|
||||||
|
|
||||||
def call(self, *args):
|
def call(self, *args):
|
||||||
print("call:", args)
|
#print("call:", args)
|
||||||
self.gramps = Gramps()
|
self.gramps = Gramps(user=User())
|
||||||
out, err = self.gramps.run(*args)
|
out, err = self.gramps.run(*args)
|
||||||
print("out:", out, "err:", err)
|
#print("out:", out, "err:", err)
|
||||||
return out, err
|
return out, err
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -105,10 +106,10 @@ class TestDynamic(unittest.TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def call(cls, *args):
|
def call(cls, *args):
|
||||||
print("call:", args)
|
#print("call:", args)
|
||||||
gramps = Gramps()
|
gramps = Gramps(user=User())
|
||||||
out, err = gramps.run(*args)
|
out, err = gramps.run(*args)
|
||||||
print("out:", out, "err:", err)
|
#print("out:", out, "err:", err)
|
||||||
return out, err
|
return out, err
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -123,7 +124,7 @@ def report_contains(text):
|
|||||||
ext = options["off"]
|
ext = options["off"]
|
||||||
with open(report_name + "." + ext) as fp:
|
with open(report_name + "." + ext) as fp:
|
||||||
contents = fp.read()
|
contents = fp.read()
|
||||||
print(contents)
|
#print(contents)
|
||||||
if options.get("files", []):
|
if options.get("files", []):
|
||||||
for filename in options.get("files", []):
|
for filename in options.get("files", []):
|
||||||
if filename is None:
|
if filename is None:
|
||||||
|
@ -39,10 +39,9 @@ const.myrand = random.Random()
|
|||||||
|
|
||||||
def call(*args):
|
def call(*args):
|
||||||
""" Call Gramps to perform the action with out and err captured """
|
""" Call Gramps to perform the action with out and err captured """
|
||||||
if __debug__:
|
#if __debug__:
|
||||||
print ("call: %s", args)
|
#print ("call: %s", args)
|
||||||
gramps = Gramps(user=User())
|
gramps = Gramps(user=User())
|
||||||
# gramps = Gramps(user=User())
|
|
||||||
out, err = gramps.run(*args)
|
out, err = gramps.run(*args)
|
||||||
# print("out:", out, "err:", err)
|
# print("out:", out, "err:", err)
|
||||||
return out, err
|
return out, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user