guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: gnu: python-mysqlclient: Enable selected tests.


From: guix-commits
Subject: 01/02: gnu: python-mysqlclient: Enable selected tests.
Date: Wed, 27 Mar 2024 11:20:58 -0400 (EDT)

hako pushed a commit to branch master
in repository guix.

commit 5a41d4a56d0d14fddc95a3e4aed12ffab3a6ca3b
Author: Marco Rimoldi <rimarko@libero.it>
AuthorDate: Sun Feb 18 23:12:05 2024 +0100

    gnu: python-mysqlclient: Enable selected tests.
    
    * gnu/packages/databases.scm (python-mysqlclient)
    [build-system]: Change to pyproject-build-system.
    [arguments]
    <#:phases>: Add 'fix-test phase.
    <#:test-flags>: Specify tests to run.
    [native-inputs]: Add python-pytest.
    [inputs]: Replace mariadb:dev with mariadb-connector-c.
    [home-page]: Update.
    
    Change-Id: I5ae0873155f9a7cc90a318762b77864665fadc01
    Signed-off-by: Hilton Chain <hako@ultrarare.space>
---
 gnu/packages/databases.scm | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 56f100e841..9b3d6ffbed 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -4207,13 +4207,22 @@ files or Python scripts that define a list of migration 
steps.")
        (method url-fetch)
        (uri (pypi-uri "mysqlclient" version))
        (sha256
-        (base32
-         "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
-    (build-system python-build-system)
-    (arguments '(#:tests? #f))          ;XXX: requires a live database
-    (inputs
-     `(("mysql-dev" ,mariadb "dev")))
-    (home-page "https://github.com/PyMySQL/mysqlclient-python";)
+        (base32 "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-before 'check 'fix-test
+                 (lambda _
+                   (substitute* "tests/test_MySQLdb_times.py"
+                     (("^import mock")
+                      "from unittest import mock")))))
+           #:test-flags
+           #~'("tests/test__mysql.py"   ;tests not needing a live db
+               "tests/test_MySQLdb_times.py")))
+    (native-inputs (list python-pytest))
+    (inputs (list mariadb-connector-c))
+    (home-page "https://github.com/PyMySQL/mysqlclient";)
     (synopsis "MySQLdb is an interface to the popular MySQL database server 
for Python")
     (description "MySQLdb is an interface to the popular MySQL database server
 for Python.  The design goals are:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]