File tree 3 files changed +10
-13
lines changed
3 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 1
1
from .core import one
2
2
from funcdesc import Val
3
3
4
- __version__ = '0.2.1 '
4
+ __version__ = '0.2.2 '
5
5
6
6
__all__ = [one , Val ]
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ def get_long_description():
37
37
38
38
def get_install_requires ():
39
39
requirements = [
40
- "funcdesc>=0.1.1 " ,
41
- "cmd2func>=0.1.2 " ,
40
+ "funcdesc>=0.1.2 " ,
41
+ "cmd2func>=0.1.4 " ,
42
42
"rich" ,
43
43
"fire" ,
44
44
"qtpy" ,
Original file line number Diff line number Diff line change 1
1
import contextlib
2
2
from io import StringIO
3
3
import os .path as osp
4
+ import sys
4
5
5
6
from oneface .wrap_cli .wrap import wrap_cli , load_config
6
7
@@ -32,22 +33,18 @@ def test_stdout():
32
33
conf = load_config (example_yaml )
33
34
wrap = wrap_cli (conf , print_cmd = False )
34
35
console_buffer = StringIO ()
35
- with contextlib .redirect_stdout (console_buffer ):
36
- wrap (40 , 2 )
37
- console_buffer .seek (0 )
38
- content = console_buffer .read ()
39
- assert content .strip () == "42"
36
+ wrap .out_stream = console_buffer
37
+ wrap (40 , 2 )
38
+ assert console_buffer .getvalue ().strip () == "42"
40
39
41
40
42
41
def test_stderr ():
43
42
conf = load_config (example_yaml )
44
43
wrap = wrap_cli (conf )
45
44
console_buffer = StringIO ()
46
- with contextlib .redirect_stderr (console_buffer ):
47
- wrap (40 , "aaa" )
48
- console_buffer .seek (0 )
49
- content = console_buffer .read ()
50
- assert "NameError" in content
45
+ wrap .err_stream = console_buffer
46
+ wrap (40 , "aaa" )
47
+ assert "NameError" in console_buffer .getvalue ()
51
48
52
49
53
50
def test_replace ():
You can’t perform that action at this time.
0 commit comments