Skip to content

Commit

Permalink
Fix flake8 warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Oct 14, 2024
1 parent 494e820 commit 4389f1a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/rez/tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ def test_execute_command_testing_environ(self):
"""Test that execute_command properly sets test specific environ dict"""
self.inject_python_repo()
packages_path = self.data_path("builds", "packages")
r = ResolvedContext(["testing_obj", "python"], testing=True, package_paths=[packages_path] + self.settings["packages_path"])
r = ResolvedContext(
["testing_obj", "python"],
testing=True,
package_paths=[packages_path] + self.settings["packages_path"]
)
self.assertEqual(r.get_environ().get("CAR_IDEA"), "STURDY STEERING WHEEL")

def test_execute_command_environ(self):
Expand Down
24 changes: 20 additions & 4 deletions src/rez/tests/test_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,26 @@ def _run_tests(self, r, verbose=2):
runner.run_test(test_name)

self.assertEqual(runner.test_results.num_tests, 4)
self.assertEqual(self._get_test_result(runner, "check_car_ideas")["status"], "success", "check_car_ideas did not succeed")
self.assertEqual(self._get_test_result(runner, "move_meeting_to_noon")["status"], "failed", "move_meeting_to_noon did not fail")
self.assertEqual(self._get_test_result(runner, "command_as_string_success")["status"], "success", "command_as_string_success did not succeed")
self.assertEqual(self._get_test_result(runner, "command_as_string_fail")["status"], "failed", "command_as_string_fail did not fail")
self.assertEqual(
self._get_test_result(runner, "check_car_ideas")["status"],
"success",
"check_car_ideas did not succeed",
)
self.assertEqual(
self._get_test_result(runner, "move_meeting_to_noon")["status"],
"failed",
"move_meeting_to_noon did not fail",
)
self.assertEqual(
self._get_test_result(runner, "command_as_string_success")["status"],
"success",
"command_as_string_success did not succeed",
)
self.assertEqual(
self._get_test_result(runner, "command_as_string_fail")["status"],
"failed",
"command_as_string_fail did not fail",
)

def _get_test_result(self, runner, test_name):
return next(
Expand Down

0 comments on commit 4389f1a

Please sign in to comment.