Spaces:
Running
Running
Skip notebook test if files not found in installed version
Browse files
pysr/test/test_startup.py
CHANGED
|
@@ -137,15 +137,22 @@ class TestStartup(unittest.TestCase):
|
|
| 137 |
self.skipTest("Julia version too old")
|
| 138 |
if platform.system() == "Windows":
|
| 139 |
self.skipTest("Notebook test incompatible with Windows")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
result = subprocess.run(
|
| 141 |
[
|
| 142 |
sys.executable,
|
| 143 |
"-m",
|
| 144 |
"pytest",
|
| 145 |
"--nbval",
|
| 146 |
-
str(
|
| 147 |
"--nbval-sanitize-with",
|
| 148 |
-
str(
|
| 149 |
],
|
| 150 |
env=os.environ,
|
| 151 |
)
|
|
|
|
| 137 |
self.skipTest("Julia version too old")
|
| 138 |
if platform.system() == "Windows":
|
| 139 |
self.skipTest("Notebook test incompatible with Windows")
|
| 140 |
+
|
| 141 |
+
notebook_file = Path(__file__).parent / "test_nb.ipynb"
|
| 142 |
+
sanitize_file = Path(__file__).parent / "nb_sanitize.cfg"
|
| 143 |
+
|
| 144 |
+
if not (notebook_file.exists() and sanitize_file.exists()):
|
| 145 |
+
self.skipTest("Files not available for testing")
|
| 146 |
+
|
| 147 |
result = subprocess.run(
|
| 148 |
[
|
| 149 |
sys.executable,
|
| 150 |
"-m",
|
| 151 |
"pytest",
|
| 152 |
"--nbval",
|
| 153 |
+
str(notebook_file),
|
| 154 |
"--nbval-sanitize-with",
|
| 155 |
+
str(sanitize_file),
|
| 156 |
],
|
| 157 |
env=os.environ,
|
| 158 |
)
|