-
Notifications
You must be signed in to change notification settings - Fork 849
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c3eaee
commit 3f491eb
Showing
2 changed files
with
50 additions
and
18 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,33 @@ | ||
from testbook import testbook | ||
import sys | ||
|
||
TIMEOUT: int = 60 | ||
|
||
|
||
def test_notebooks(): | ||
if sys.environ.get("SHOULD_TEST_ALL_FILES", "") == "true": | ||
notebooks_to_test = get_all_notebooks() | ||
else: | ||
if sys.environ.get("HAS_ANY_IPYNB_CHANGED", "") == "true": | ||
notebooks_to_test = sys.environ.get("LIST_OF_IPYNB_CHANGED", "").split() | ||
else: | ||
return | ||
|
||
# for notebook_path in notebooks_to_test: | ||
# with testbook( | ||
# notebook_path, | ||
# execute=True, | ||
# timeout=TIMEOUT, | ||
# allow_errors=False, | ||
# ) as tb: | ||
# pass # we simply wish it to run without errors | ||
|
||
print(notebooks_to_test) | ||
assert False | ||
|
||
|
||
def get_all_notebooks(): | ||
for root, dirs, files in os.walk(directory): | ||
for file in files: | ||
if file.endswith(".ipynb"): | ||
yield os.path.join(root, file) |