cros_sdk_unittest: rework skipping logic for python3
The code already passes under Python 3 as well as it passes under
Python 2, so drop it from the disable list. But also move the skip
logic from the main runner to the individual test runner so it's a
bit more obvious that it isn't supposed to pass.
BUG=chromium:997354
TEST=`./run_tests` passes
Change-Id: I8d27a9d7a35798ef4b70b772a9b56c2a88964e7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1932718
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/cros_sdk_unittest.py b/scripts/cros_sdk_unittest.py
index aec7a54..ad4a82e 100644
--- a/scripts/cros_sdk_unittest.py
+++ b/scripts/cros_sdk_unittest.py
@@ -8,6 +8,7 @@
from __future__ import print_function
import os
+import unittest
from chromite.lib import cros_build_lib
from chromite.lib import cros_logging as logging
@@ -17,6 +18,11 @@
from chromite.lib import sudo
+# This long decorator triggers a false positive in the docstring test.
+# https://github.com/PyCQA/pylint/issues/3077
+# pylint: disable=bad-docstring-quotes
+@unittest.skipIf(cros_build_lib.IsInsideChroot(),
+ 'Tests only make sense outside the chroot')
class CrosSdkPrerequisitesTest(cros_test_lib.TempDirTestCase):
"""Tests for required packages on the host machine.
@@ -47,8 +53,11 @@
self.assertEqual(result.returncode, 0)
-# TODO(bmgordon): Figure out how to mock out --create and --enter and then
-# add tests that combine those with snapshots.
+@unittest.skipIf(cros_build_lib.IsInsideChroot(),
+ 'Tests only make sense outside the chroot')
+@unittest.skip(
+ 'These are triggering hangs inside lvm when run through run_tests. '
+ 'https://crbug.com/764335')
class CrosSdkSnapshotTest(cros_test_lib.TempDirTestCase):
"""Tests for the snapshot functionality in cros_sdk."""