Repository: AcademySoftwareFoundation/rez (language: python)

Issue:
failed tests in pytest-enabled rez-selftest are not getting picked up
rez-selftest is exiting with exitcode 0 even if a test fails.



Discussion / hints:

Fix patch:
diff --git a/src/rez/utils/_version.py b/src/rez/utils/_version.py
index 69aec4732..e4c169dc2 100644
--- a/src/rez/utils/_version.py
+++ b/src/rez/utils/_version.py
@@ -1,7 +1,7 @@
 
 
 # Update this value to version up Rez. Do not place anything else in this file.
-_rez_version = "2.93.2"
+_rez_version = "2.93.3"
 
 
 # Copyright 2013-2016 Allan Johns.


Test patch:
diff --git a/src/rez/cli/selftest.py b/src/rez/cli/selftest.py
index f0db61140..9ea7f4207 100644
--- a/src/rez/cli/selftest.py
+++ b/src/rez/cli/selftest.py
@@ -124,7 +124,8 @@ def run_pytest(module_tests, tests, verbosity, extra_arg_groups):
     if extra_arg_groups:
         argv += extra_arg_groups[0]
 
-    main(args=argv)
+    exitcode = main(args=argv)
+    sys.exit(exitcode)
 
 
 # Copyright 2013-2016 Allan Johns.
diff --git a/src/rez/tests/test_package_cache.py b/src/rez/tests/test_package_cache.py
index cd5ff6420..7a67078f5 100644
--- a/src/rez/tests/test_package_cache.py
+++ b/src/rez/tests/test_package_cache.py
@@ -157,7 +157,8 @@ def test_caching_on_resolve(self):
         for ref in ("resolve.timestamped.root", "'{resolve.timestamped.root}'"):
             proc = c.execute_rex_code(
                 code="info(%s)" % ref,
-                stdout=subprocess.PIPE
+                stdout=subprocess.PIPE,
+                universal_newlines=True
             )
 
             out, _ = proc.communicate()