Exemple #1
0
def test_safe_print_string():
    """[Utils] safe_print: accepts flush and stream name as string."""

    with open(os.devnull, 'w') as f, redirect_stdout(f):
        utils.safe_print('test', flush=True, file="stdout")
Exemple #2
0
def test_safe_print():
    """[Utils] safe_print: prints correctly."""
    l = Logger()
    utils.safe_print('test', file=l)
    assert l.log[0] == 'test'