Subject: [bug#50018] [PATCH 09/19] gnu: python-moto: Respect #:tests?.

From: Vinicius Monego <[email-masked]>
Date: Wed, 11 Aug 2021 23:45:01 +0000

* gnu/packages/python-xyz.scm (python-moto)[source]: Make some cosmetic
changes.
[arguments]: Respect #:tests? in the custom 'check phase.
---
 gnu/packages/python-xyz.scm | 81 +++++++++++++++++++------------------
 1 file changed, 41 insertions(+), 40 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 57b4e7fa58..0b358ceca3 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -12475,12 +12475,12 @@ text.")
   (package
     (name "python-moto")
     (version "2.2.2")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "moto" version))
-              (sha256
-               (base32
-                "09dpjxp7xb5y1haj5aq6f5lcfzjd0121xqv75zyk6j6bkcbskddh"))))
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "moto" version))
+       (sha256
+        (base32 "09dpjxp7xb5y1haj5aq6f5lcfzjd0121xqv75zyk6j6bkcbskddh"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -12494,40 +12494,41 @@ text.")
                (("#!/bin/bash")
                 (string-append "#!" (which "bash"))))))
          (replace 'check
-           (lambda _
-             (setenv "PYTHONPATH" (string-append "./build/lib:"
-                                                 (getenv "PYTHONPATH")))
-             (invoke "pytest" "-vv" "-m" "not network" "-k"
-                     ;; These tests require Docker.
-                     (string-append "not test_terminate_job"
-                                    " and not test_invoke_function_from_sqs_exception"
-                                    " and not test_rotate_secret_lambda_invocations"
-                                    ;; No indication of why this one fails.
-                                    " and not test_container_overrides"
-                                    " and not test_dependencies"
-                                    ;; Exception from python-botocore 1.19.22.
-                                    ;; XXX: May pass after update.
-                                    " and not test_object_headers"
-                                    " and not test_delete_connection_not_present"
-                                    " and not test_delete_connection_success"
-                                    " and not test_describe_connection_not_present"
-                                    " and not test_describe_connection_success"
-                                    " and not test_delete_api_destination"
-                                    " and not test_create_and_list_api_destinations"
-                                    " and not test_delete_connection"
-                                    " and not test_create_and_describe_connection"
-                                    " and not test_create_and_list_connections"
-                                    " and not test_create_file_system_az_name_given_backup_default"
-                                    " and not test_create_file_system_aws_sample_2"
-                                    " and not test_describe_file_systems_aws_create_sample_2"
-                                    " and not test_create_file_system_aws_sample_1"
-                                    " and not test_create_image_with_tag_specification"
-                                    " and not test_get_group_configuration"
-                                    " and not test_create_and_update_api_destination"
-                                    ;; Exception from python-sure 1.4.11.
-                                    ;; XXX: May pass after update.
-                                    " and not test_encryption"
-                                    " and not test_create_transit_gateway")))))))
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (setenv "PYTHONPATH" (string-append "./build/lib:"
+                                                   (getenv "PYTHONPATH")))
+               (invoke "pytest" "-vv" "-m" "not network" "-k"
+                       ;; These tests require Docker.
+                       (string-append "not test_terminate_job"
+                                      " and not test_invoke_function_from_sqs_exception"
+                                      " and not test_rotate_secret_lambda_invocations"
+                                      ;; No indication of why this one fails.
+                                      " and not test_container_overrides"
+                                      " and not test_dependencies"
+                                      ;; Exception from python-botocore 1.19.22.
+                                      ;; XXX: May pass after update.
+                                      " and not test_object_headers"
+                                      " and not test_delete_connection_not_present"
+                                      " and not test_delete_connection_success"
+                                      " and not test_describe_connection_not_present"
+                                      " and not test_describe_connection_success"
+                                      " and not test_delete_api_destination"
+                                      " and not test_create_and_list_api_destinations"
+                                      " and not test_delete_connection"
+                                      " and not test_create_and_describe_connection"
+                                      " and not test_create_and_list_connections"
+                                      " and not test_create_file_system_az_name_given_backup_default"
+                                      " and not test_create_file_system_aws_sample_2"
+                                      " and not test_describe_file_systems_aws_create_sample_2"
+                                      " and not test_create_file_system_aws_sample_1"
+                                      " and not test_create_image_with_tag_specification"
+                                      " and not test_get_group_configuration"
+                                      " and not test_create_and_update_api_destination"
+                                      ;; Exception from python-sure 1.4.11.
+                                      ;; XXX: May pass after update.
+                                      " and not test_encryption"
+                                      " and not test_create_transit_gateway"))))))))
     (native-inputs
      `(("python-flask" ,python-flask)
        ("python-flask-cors" ,python-flask-cors)
-- 
2.30.2