Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
9b3be67
1
Parent(s):
2a98f83
Update CLI tests
Browse files- pysr/_cli/main.py +2 -2
- pysr/test/test_cli.py +16 -16
pysr/_cli/main.py
CHANGED
@@ -44,7 +44,7 @@ def _install(julia_project, quiet, precompile):
|
|
44 |
)
|
45 |
|
46 |
|
47 |
-
TEST_OPTIONS = {"main", "jax", "torch", "cli", "
|
48 |
|
49 |
|
50 |
@pysr.command("test")
|
@@ -52,7 +52,7 @@ TEST_OPTIONS = {"main", "jax", "torch", "cli", "warm_start"}
|
|
52 |
def _tests(tests):
|
53 |
"""Run parts of the PySR test suite.
|
54 |
|
55 |
-
Choose from main, jax, torch, cli, and
|
56 |
"""
|
57 |
for test in tests.split(","):
|
58 |
if test in TEST_OPTIONS:
|
|
|
44 |
)
|
45 |
|
46 |
|
47 |
+
TEST_OPTIONS = {"main", "jax", "torch", "cli", "warm-start"}
|
48 |
|
49 |
|
50 |
@pysr.command("test")
|
|
|
52 |
def _tests(tests):
|
53 |
"""Run parts of the PySR test suite.
|
54 |
|
55 |
+
Choose from main, jax, torch, cli, and warm-start. You can give multiple tests, separated by commas.
|
56 |
"""
|
57 |
for test in tests.split(","):
|
58 |
if test in TEST_OPTIONS:
|
pysr/test/test_cli.py
CHANGED
@@ -20,15 +20,15 @@ def get_runtests():
|
|
20 |
Usage: pysr [OPTIONS] COMMAND [ARGS]...
|
21 |
|
22 |
Options:
|
23 |
-
|
24 |
|
25 |
Commands:
|
26 |
-
|
27 |
-
|
28 |
"""
|
29 |
)
|
30 |
result = self.cli_runner.invoke(pysr, ["--help"])
|
31 |
-
self.assertEqual(result.output, expected)
|
32 |
self.assertEqual(result.exit_code, 0)
|
33 |
|
34 |
def test_help_on_install(self):
|
@@ -36,18 +36,18 @@ def get_runtests():
|
|
36 |
"""
|
37 |
Usage: pysr install [OPTIONS]
|
38 |
|
39 |
-
|
40 |
|
41 |
Options:
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
"""
|
48 |
)
|
49 |
result = self.cli_runner.invoke(pysr, ["install", "--help"])
|
50 |
-
self.assertEqual(result.output, expected)
|
51 |
self.assertEqual(result.exit_code, 0)
|
52 |
|
53 |
def test_help_on_test(self):
|
@@ -55,17 +55,17 @@ def get_runtests():
|
|
55 |
"""
|
56 |
Usage: pysr test [OPTIONS] TESTS
|
57 |
|
58 |
-
|
59 |
|
60 |
-
|
61 |
-
|
62 |
|
63 |
Options:
|
64 |
-
|
65 |
"""
|
66 |
)
|
67 |
result = self.cli_runner.invoke(pysr, ["test", "--help"])
|
68 |
-
self.assertEqual(result.output, expected)
|
69 |
self.assertEqual(result.exit_code, 0)
|
70 |
|
71 |
def runtests():
|
|
|
20 |
Usage: pysr [OPTIONS] COMMAND [ARGS]...
|
21 |
|
22 |
Options:
|
23 |
+
--help Show this message and exit.
|
24 |
|
25 |
Commands:
|
26 |
+
install DEPRECATED (dependencies are now installed at import).
|
27 |
+
test Run parts of the PySR test suite.
|
28 |
"""
|
29 |
)
|
30 |
result = self.cli_runner.invoke(pysr, ["--help"])
|
31 |
+
self.assertEqual(result.output.strip(), expected.strip())
|
32 |
self.assertEqual(result.exit_code, 0)
|
33 |
|
34 |
def test_help_on_install(self):
|
|
|
36 |
"""
|
37 |
Usage: pysr install [OPTIONS]
|
38 |
|
39 |
+
DEPRECATED (dependencies are now installed at import).
|
40 |
|
41 |
Options:
|
42 |
+
-p, --project TEXT
|
43 |
+
-q, --quiet Disable logging.
|
44 |
+
--precompile
|
45 |
+
--no-precompile
|
46 |
+
--help Show this message and exit.
|
47 |
"""
|
48 |
)
|
49 |
result = self.cli_runner.invoke(pysr, ["install", "--help"])
|
50 |
+
self.assertEqual(result.output.strip(), expected.strip())
|
51 |
self.assertEqual(result.exit_code, 0)
|
52 |
|
53 |
def test_help_on_test(self):
|
|
|
55 |
"""
|
56 |
Usage: pysr test [OPTIONS] TESTS
|
57 |
|
58 |
+
Run parts of the PySR test suite.
|
59 |
|
60 |
+
Choose from main, jax, torch, cli, and warm-start. You can give multiple
|
61 |
+
tests, separated by commas.
|
62 |
|
63 |
Options:
|
64 |
+
--help Show this message and exit.
|
65 |
"""
|
66 |
)
|
67 |
result = self.cli_runner.invoke(pysr, ["test", "--help"])
|
68 |
+
self.assertEqual(result.output.strip(), expected.strip())
|
69 |
self.assertEqual(result.exit_code, 0)
|
70 |
|
71 |
def runtests():
|