#5218 tests: Skip style checks when style check tools are not installed
Merged 2 years ago by ngompa. Opened 2 years ago by ngompa.
ngompa/pagure autoskip-style-tests  into  master

file modified
+14
@@ -34,7 +34,14 @@ 

  

          This test runs flake8 on the code, and will fail if it returns a

          non-zero exit code.

+         If flake8 is not installed, this test auto-skips.

          """

+         try:

+             import flake8

+         except ImportError as e:

+             raise unittest.SkipTest(

+                 "flake8 is not installed, skipping flake8 style check..."

+             )

          # We ignore E712, which disallows non-identity comparisons with True and False

          # We ignore W503, which disallows line break before binary operator

          flake8_command = [
@@ -77,7 +84,14 @@ 

  

          This test runs black on the code, and will fail if it returns a

          non-zero exit code.

+         If black is not installed, this test auto-skips.

          """

+         try:

+             import black

+         except ImportError as e:

+             raise unittest.SkipTest(

+                 "black is not installed, skipping black style check..."

+             )

          black_command = [

              sys.executable,

              "-m",

We do not necessarily want the test suite to fail when the style
check tools are not installed, since that invalidates the usability
of unit tests in packaging and other environments where style
checking is not important.

rebased onto 81c47ae69c73557373e9ff4eb92f05d66141b324

2 years ago

rebased onto 1e88d0c7b4ca844a065871f927f83fce7367828a

2 years ago

pretty please pagure-ci rebuild

2 years ago

rebased onto b4bd95e

2 years ago

Pull-Request has been merged by ngompa

2 years ago
Metadata