-
-
Notifications
You must be signed in to change notification settings - Fork 890
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pyodide-interrupt package (#852)
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package: | ||
name: pyodide-interrupts | ||
version: 0.1.1 | ||
|
||
source: | ||
url: https://files.pythonhosted.org/packages/b1/c2/918c52e47bf91570d9883a1c761c4d78a59cf4d1d8f8c67c25a4e164ff87/pyodide-interrupts-0.1.1.tar.gz | ||
sha256: b85bc38b92cd5c35dd1a5192a71495abe4cd57eadccfacbc0421fb44fb6c9e74 | ||
|
||
test: | ||
imports: | ||
- pyodide_interrupts |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
def test_pyodide_interrupts(selenium): | ||
selenium.load_package("pyodide-interrupts") | ||
selenium.run("from pyodide_interrupts import check_interrupts") | ||
assert ( | ||
selenium.run( | ||
"x = 0\n" | ||
"def callback():\n" | ||
" global x\n" | ||
" print('check')\n" | ||
" x += 1\n" | ||
"with check_interrupts(callback, 10):\n" | ||
" for i in range(50):\n" | ||
" print(i, end=',')\n" | ||
"x" | ||
) | ||
== 11 | ||
) |