Skip to content

Commit

Permalink
fixes test
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Li <[email protected]>
  • Loading branch information
wyli committed Oct 10, 2023
1 parent 732cc50 commit 9babee4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/test_integration_bundle_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ def test_tiny(self):
with self.assertRaises(RuntimeError):
# test wrong run_id="run"
command_line_tests(cmd + ["run", "run", "--config_file", config_file])
with self.assertRaises(RuntimeError):
# test missing meta file
command_line_tests(cmd + ["run", "training", "--config_file", config_file])
# test missing meta file
self.assertIn("ERROR", command_line_tests(cmd + ["run", "training", "--config_file", config_file]))

def test_scripts_fold(self):
# test scripts directory has been added to Python search directories automatically
Expand Down Expand Up @@ -150,9 +149,8 @@ def test_scripts_fold(self):
print(output)
self.assertTrue(expected_condition in output)

with self.assertRaises(RuntimeError):
# test missing meta file
command_line_tests(cmd + ["run", "training", "--config_file", config_file])
# test missing meta file
self.assertIn("ERROR", command_line_tests(cmd + ["run", "training", "--config_file", config_file]))

@parameterized.expand([TEST_CASE_1, TEST_CASE_2])
def test_shape(self, config_file, expected_shape):
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ def command_line_tests(cmd, copy_env=True):
try:
normal_out = subprocess.run(cmd, env=test_env, check=True, capture_output=True)
print(repr(normal_out).replace("\\n", "\n").replace("\\t", "\t"))
return repr(normal_out)
except subprocess.CalledProcessError as e:
output = repr(e.stdout).replace("\\n", "\n").replace("\\t", "\t")
errors = repr(e.stderr).replace("\\n", "\n").replace("\\t", "\t")
Expand Down

0 comments on commit 9babee4

Please sign in to comment.