File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 2
2
import pytest
3
3
4
4
5
- def test_basics ():
5
+ def test_basics (capsys ):
6
6
dart .common .trace ("trace log" )
7
7
dart .common .debug ("debug log" )
8
8
dart .common .info ("info log" )
9
9
dart .common .warn ("warn log" )
10
10
dart .common .error ("error log" )
11
11
dart .common .fatal ("fatal log" )
12
12
13
+ captured = capsys .readouterr ()
14
+ combined = captured .out + captured .err
13
15
14
- def test_arguments ():
16
+ assert "trace log" in combined
17
+ assert "debug log" in combined
18
+ assert "info log" in combined
19
+ assert "warn log" in combined
20
+ assert "error log" in combined
21
+ assert "fatal log" in combined
22
+
23
+
24
+ def test_arguments (capsys ):
15
25
val = 10
16
26
dart .common .info ("Log with param '{}' and '{}'" .format (1 , val ))
27
+ captured = capsys .readouterr ()
28
+ combined = captured .out + captured .err
29
+ assert "Log with param '1' and '10'" in combined
17
30
18
31
19
32
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments