-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202146 from Homebrew/jupyterlab-test
jupyterlab: replace `expect` dependency with Ruby libs
- Loading branch information
Showing
1 changed file
with
10 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,6 @@ class Jupyterlab < Formula | |
depends_on "[email protected]" | ||
depends_on "zeromq" | ||
|
||
uses_from_macos "expect" => :test | ||
uses_from_macos "libffi" | ||
uses_from_macos "libxml2" | ||
uses_from_macos "libxslt" | ||
|
@@ -559,22 +558,17 @@ def caveats | |
end | ||
|
||
test do | ||
system bin/"jupyter-console --help" | ||
assert_match "The Jupyter terminal-based Console", shell_output("#{bin}/jupyter-console --help") | ||
assert_match python3, shell_output("#{bin}/jupyter kernelspec list") | ||
|
||
(testpath/"console.exp").write <<~EOS | ||
spawn #{bin}/jupyter-console | ||
expect -timeout 60 "In " | ||
send "exit\r" | ||
EOS | ||
assert_match "Jupyter console", shell_output("expect -f console.exp") | ||
|
||
(testpath/"notebook.exp").write <<~EOS | ||
set timeout 60 | ||
spawn #{bin}/jupyter notebook --no-browser | ||
expect "ServerApp" | ||
EOS | ||
assert_match "ServerApp", shell_output("expect -f notebook.exp") | ||
assert_match(/In \[1\]:.*exit.*Shutting down/m, pipe_output("#{bin}/jupyter-console 2>&1", "exit")) | ||
|
||
require "expect" | ||
require "open3" | ||
Open3.popen3(bin/"jupyter", "notebook", "--no-browser") do |_stdin, _stdout, stderr, wait_thread| | ||
refute_nil stderr.expect("Serving notebooks from local directory:", 15), "Expected running message" | ||
ensure | ||
Process.kill "TERM", wait_thread.pid | ||
end | ||
|
||
(testpath/"nbconvert.ipynb").write <<~JSON | ||
{ | ||
|