Subject: [PATCH v3 2/2] gnu: python-tox: Add native-inputs and enable tests.

From: Nicolas Graves <[email-masked]>
Date: Sun, 21 Aug 2022 00:33:53 +0200

* gnu/packages/python-check.scm (python-tox): Add native-inputs and enable
tests.
---
 gnu/packages/python-check.scm | 45 ++++++++++++++++++++++++++++++-----
 1 file changed, 39 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 5d6cf49c50..a5eb06f249 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2438,9 +2438,40 @@ (define-public python-tox
          "0nk0nyzhzamcrvn0qqzzy54isxxqwdi28swml7a2ym78c3f9sqpb"))))
     (build-system python-build-system)
     (arguments
-     ;; FIXME: Tests require pytest-timeout, which itself requires
-     ;; pytest>=2.8.0 for installation.
-     '(#:tests? #f))
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (if tests?
+                 (invoke
+                  "pytest" "-vv"
+                  "-k"
+                  (string-append
+                   "not test_invocation_error "
+                   "and not test_create_KeyboadInterrupt "
+                   "and not test_exit_code "
+                   "and not test_tox_get_python_executable "
+                   "and not test_find_alias_on_path "
+                   "and not test_get_executable "
+                   "and not test_get_executable_no_exist "
+                   "and not test_get_sitepackagesdir_error "
+                   "and not test_spinner_stdout_not_unicode "
+                   "and not test_provision_non_canonical_dep "
+                   "and not test_package_setuptools "
+                   "and not test_package_poetry "
+                   "and not test_parallel_interrupt "
+                   "and not test_provision_missing "
+                   "and not test_provision_from_pyvenv "
+                   "and not test_provision_interrupt_child "
+                   "and not test_create "
+                   "and not test_run_custom_install_command "
+                   "and not test_toxuone_env "
+                   "and not test_different_config_cwd "
+                   "and not test_test_usedevelop "
+                   "and not test_build_backend_without_submodule "
+                   "and not test_parallel "
+                   "and not test_parallel_live "
+                   "and not test_tox_env_var_flags_inserted_isolated "))))))))
     (propagated-inputs
      (list python-filelock
            python-packaging
@@ -2450,9 +2481,11 @@ (define-public python-tox
            python-toml
            python-virtualenv))
     (native-inputs
-     (list ; FIXME: Missing: ("python-pytest-timeout" ,python-pytest-timeout)
-      python-pytest ; >= 2.3.5
-      python-setuptools-scm))
+     (list python-flaky
+           python-pathlib2
+           python-pytest-timeout
+           python-pytest
+           python-setuptools-scm))
     (home-page "https://tox.readthedocs.io")
     (synopsis "Virtualenv-based automation of test activities")
     (description "Tox is a generic virtualenv management and test command line
-- 
2.37.2