Completed
Push — master ( dbc38f...56accc )
by Klaus
01:34
created

test_example()   B

Complexity

Conditions 6

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 6
dl 0
loc 16
rs 8
c 0
b 0
f 0
1
#!/usr/bin/env python
2
# coding=utf-8
3
from __future__ import division, print_function, unicode_literals
4
5
6
# example_test will be parametrized by the test generation hook in conftest.py
7
def test_example(capsys, example_test):
8
    ex, call, out = example_test
9
    ex.run_commandline(call)
10
    captured_out, captured_err = capsys.readouterr()
11
    print(captured_out)
12
    print(captured_err)
13
    captured_out = captured_out.split('\n')
14
    captured_err = captured_err.split('\n')
15
    for out_line in out:
16
        assert out_line in [captured_out[0], captured_err[0]]
17
        if out_line == captured_out[0]:
18
            captured_out.pop(0)
19
        else:
20
            captured_err.pop(0)
21
    assert captured_out == ['']
22
    assert captured_err == ['']
23