From 287df4fbd34a7d0d0cc29403b2b24a491c124205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 18 Jul 2025 14:10:28 +0200 Subject: [PATCH 1/2] Move third-party library imports to specific tests Move third-party (`pylibmc` and `MySQLdb`) imports to specific tests, rather than importing them in global scope. This makes it easier to test a subset of the package without having to install all the dependencies, which can be particularly problematic when wheels are not provided (e.g. on PyPy3.11 or CPython 3.14). --- tests/test_plugin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 0eb7554..a6498f8 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -2,12 +2,11 @@ import os.path import socket -import pylibmc -import MySQLdb - def test_memcached(request, memcached, memcached_socket): """Test memcached service.""" + import pylibmc + mc = pylibmc.Client([memcached_socket]) mc.set('some', 1) assert mc.get('some') == 1 @@ -19,6 +18,8 @@ def test_memcached(request, memcached, memcached_socket): def test_mysql(mysql, mysql_connection, mysql_socket): """Test mysql service.""" + import MySQLdb + conn = MySQLdb.connect(user='root', unix_socket=mysql_socket) assert conn From e0fb2f98e91f9024ac876fa205e64b54fe0a7900 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 18 Jul 2025 09:19:57 -0300 Subject: [PATCH 2/2] Update CHANGES.rst --- CHANGES.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 87963c2..04c7afe 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,11 @@ Changelog ========= +UNRELEASED +---------- + +- #52: Move ``pylibmc`` and ``MySQLdb`` library imports to specific tests -- this makes it easier to test a subset of the ``pytest-services`` package without having to install all the dependencies. + 2.2.2 -----