File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-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
+ captured = capsys .readouterr ()
8
+ assert "trace log" in captured .out or "trace log" in captured .err
9
+
7
10
dart .common .debug ("debug log" )
11
+ captured = capsys .readouterr ()
12
+ assert "debug log" in captured .out or "debug log" in captured .err
13
+
8
14
dart .common .info ("info log" )
15
+ captured = capsys .readouterr ()
16
+ assert "info log" in captured .out or "info log" in captured .err
17
+
9
18
dart .common .warn ("warn log" )
19
+ captured = capsys .readouterr ()
20
+ assert "warn log" in captured .out or "warn log" in captured .err
21
+
10
22
dart .common .error ("error log" )
23
+ captured = capsys .readouterr ()
24
+ assert "error log" in captured .out or "error log" in captured .err
25
+
11
26
dart .common .fatal ("fatal log" )
27
+ captured = capsys .readouterr ()
28
+ assert "fatal log" in captured .out or "fatal log" in captured .err
12
29
13
30
14
- def test_arguments ():
31
+ def test_arguments (capsys ):
15
32
val = 10
16
33
dart .common .info ("Log with param '{}' and '{}'" .format (1 , val ))
34
+ captured = capsys .readouterr ()
35
+ assert "Log with param '1' and '10'" in captured .out or "Log with param '1' and '10'" in captured .err
17
36
18
37
19
38
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments