def _print(self, out, newline=False): """ Print to the console, add a newline if necissary For the verbose logger there are times that one wants both an overwritten line, and a line that is static. This method adds the ability to print a newline charcater at the end of the line. This is useful for the non-status lines (running: <name>, and <status>: <name>), since these lines should be be overwritten, but the running status line should. """ super(VerboseLog, self)._print(grouptools.format(out)) if newline: sys.stdout.write('\n') sys.stdout.flush()
def test_basic(self): """grouptools.format: replaces grouptools.SEPARATOR with '/'""" test_str = grouptools.SEPARATOR.join(['foo', 'bar', 'boink']) assert grouptools.format(test_str) == 'foo/bar/boink'
def _print_result(results, list_): """Takes a list of test names to print and prints the name and result.""" for test in sorted(list_): print("{test}: {statuses}".format( test=grouptools.format(test), statuses=' '.join(str(r) for r in results.get_result(test))))
def test_format(): """grouptools.format: replaces {separator} with '/'""" test_str = grouptools.SEPARATOR.join(['foo', 'bar', 'boink']) nt.eq_(grouptools.format(test_str), 'foo/bar/boink')