Skip to content

Commit e3fc606

Browse files
committed
Use exit code from pytest.main in pytest.jl
1 parent d2d4ff5 commit e3fc606

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/convenience.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,16 @@ function test_replhelper(args=``; inprocess=false, kwargs...)
153153
end
154154
end
155155

156-
function test_replhelper_inprocess(args; revise=true)
156+
function test_replhelper_inprocess(args; revise=true, check=true)
157157
IPython._start_ipython(:ipython_options) # setup replhelper.core._Main
158158
if revise
159159
pyimport("replhelper")[:revise]()
160160
end
161161
cd(@__DIR__) do
162162
code = pyimport("pytest")[:main](collect(args))
163+
if !check
164+
return code
165+
end
163166
if code != 0
164167
error("$(`pytest $args`) failed with code $code")
165168
end

src/pytest.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@ Examples:
1414
"""
1515

1616
using IPython
17-
IPython.test_replhelper(`$ARGS`; inprocess=true)
17+
code = IPython.test_replhelper(
18+
`$ARGS`;
19+
inprocess = true,
20+
revise = false,
21+
check = false,
22+
)
23+
exit(code)

0 commit comments

Comments
 (0)