File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 5
5
6
6
from __future__ import annotations
7
7
8
+ import sys
9
+
8
10
import pytest
9
11
10
12
@@ -34,3 +36,11 @@ def pytest_collection_modifyitems(config, items):
34
36
for item in items :
35
37
if "extra_mlips" in item .keywords :
36
38
item .add_marker (skip_extra_mlips )
39
+
40
+
41
+ @pytest .fixture (autouse = True )
42
+ def capture_wrap ():
43
+ """Block closure of stderr and stdout."""
44
+ sys .stderr .close = lambda * args , ** kwargs : None
45
+ sys .stdout .close = lambda * args , ** kwargs : None
46
+ yield
Original file line number Diff line number Diff line change @@ -42,30 +42,26 @@ def test_neb():
42
42
43
43
assert not results_dir .exists ()
44
44
45
- import subprocess
46
-
47
45
try :
48
- result = subprocess .run (
46
+ result = runner .invoke (
47
+ app ,
49
48
[
50
- "janus" ,
51
49
"neb" ,
52
50
"--init-struct" ,
53
- str ( DATA_PATH / "LiFePO4_start.cif" ) ,
51
+ DATA_PATH / "LiFePO4_start.cif" ,
54
52
"--final-struct" ,
55
- str ( DATA_PATH / "LiFePO4_end.cif" ) ,
53
+ DATA_PATH / "LiFePO4_end.cif" ,
56
54
"--interpolator" ,
57
55
"pymatgen" ,
58
56
"--fmax" ,
59
- str ( 5 ) ,
57
+ 5 ,
60
58
"--n-images" ,
61
- str ( 5 ) ,
59
+ 5 ,
62
60
"--plot-band" ,
63
61
"--write-band" ,
64
62
],
65
- capture_output = True ,
66
- check = True ,
67
63
)
68
- assert result .returncode == 0
64
+ assert result .exit_code == 0
69
65
70
66
assert results_path .exists ()
71
67
assert band_path .exists ()
You can’t perform that action at this time.
0 commit comments