pytest-services 2.2.2__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytest_services-2.2.2 → pytest_services-2.3.0}/.github/workflows/deploy.yml +3 -3
- {pytest_services-2.2.2 → pytest_services-2.3.0}/.github/workflows/test.yml +2 -2
- {pytest_services-2.2.2 → pytest_services-2.3.0}/CHANGES.rst +9 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/PKG-INFO +15 -5
- {pytest_services-2.2.2 → pytest_services-2.3.0}/docs/conf.py +5 -6
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/folders.py +12 -12
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/locks.py +9 -9
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/log.py +2 -2
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/memcached.py +1 -1
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/mysql.py +13 -13
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/process.py +2 -2
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/service.py +4 -4
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/xvfb.py +4 -4
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services.egg-info/PKG-INFO +15 -5
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services.egg-info/SOURCES.txt +1 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services.egg-info/requires.txt +3 -0
- pytest_services-2.3.0/pytest_services.egg-info/scm_file_list.json +37 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/setup.py +3 -5
- {pytest_services-2.2.2 → pytest_services-2.3.0}/tests/test_plugin.py +4 -3
- {pytest_services-2.2.2 → pytest_services-2.3.0}/tox.ini +1 -2
- {pytest_services-2.2.2 → pytest_services-2.3.0}/.coveragerc +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/.gitignore +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/.readthedocs.yaml +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/AUTHORS.rst +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/LICENSE.txt +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/README.rst +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/RELEASING.rst +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/docs/Makefile +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/docs/api/index.rst +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/docs/index.rst +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pyproject.toml +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/__init__.py +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/django_settings.py +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/gui.py.orig +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services/plugin.py +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services.egg-info/dependency_links.txt +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services.egg-info/entry_points.txt +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services.egg-info/top_level.txt +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/requirements-testing.txt +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/setup.cfg +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/tests/__init__.py +0 -0
- {pytest_services-2.2.2 → pytest_services-2.3.0}/tests/conftest.py +0 -0
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
- uses: actions/checkout@v4
|
|
24
24
|
|
|
25
25
|
- name: Build and Check Package
|
|
26
|
-
uses: hynek/build-and-inspect-python-package@
|
|
26
|
+
uses: hynek/build-and-inspect-python-package@v3.0.2
|
|
27
27
|
with:
|
|
28
28
|
attest-build-provenance-github: 'true'
|
|
29
29
|
|
|
@@ -46,7 +46,7 @@ jobs:
|
|
|
46
46
|
path: dist
|
|
47
47
|
|
|
48
48
|
- name: Publish package to PyPI
|
|
49
|
-
uses: pypa/gh-action-pypi-publish@v1.
|
|
49
|
+
uses: pypa/gh-action-pypi-publish@v1.14.3
|
|
50
50
|
with:
|
|
51
51
|
attestations: true
|
|
52
52
|
|
|
@@ -61,4 +61,4 @@ jobs:
|
|
|
61
61
|
uses: softprops/action-gh-release@v2
|
|
62
62
|
with:
|
|
63
63
|
files: dist/*
|
|
64
|
-
tag_name: v${{ github.event.inputs.version }}
|
|
64
|
+
tag_name: v${{ github.event.inputs.version }}
|
|
@@ -26,7 +26,7 @@ jobs:
|
|
|
26
26
|
steps:
|
|
27
27
|
- uses: actions/checkout@v4
|
|
28
28
|
- name: Build and Check Package
|
|
29
|
-
uses: hynek/build-and-inspect-python-package@
|
|
29
|
+
uses: hynek/build-and-inspect-python-package@v3.0.2
|
|
30
30
|
|
|
31
31
|
test:
|
|
32
32
|
needs: [package]
|
|
@@ -36,7 +36,7 @@ jobs:
|
|
|
36
36
|
strategy:
|
|
37
37
|
fail-fast: false
|
|
38
38
|
matrix:
|
|
39
|
-
python: ["3.
|
|
39
|
+
python: ["3.11", "3.12", "3.13", "3.14", "3.15"]
|
|
40
40
|
|
|
41
41
|
steps:
|
|
42
42
|
- uses: actions/checkout@v4
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
2.3.0
|
|
5
|
+
-----
|
|
6
|
+
|
|
7
|
+
- #57: Dropped support for Python 3.9 and 3.10; Python 3.11+ is now required.
|
|
8
|
+
- #57: Added official support for Python 3.15.
|
|
9
|
+
- #57: Fixed the ``memcached`` extra, which was silently ignored: ``pip install pytest-services[memcached]`` now installs ``pylibmc``.
|
|
10
|
+
- #55: Use ``pytest.fixture`` instead of the deprecated ``pytest.yield_fixture``, which warns with ``PytestRemovedIn10Warning`` on pytest 9.
|
|
11
|
+
- #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.
|
|
12
|
+
|
|
4
13
|
2.2.2
|
|
5
14
|
-----
|
|
6
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pytest-services
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Services plugin for pytest testing framework
|
|
5
5
|
Home-page: https://github.com/pytest-dev/pytest-services
|
|
6
6
|
Author: Anatoly Bubenkov, Paylogic International and others
|
|
@@ -14,15 +14,13 @@ Classifier: Operating System :: MacOS :: MacOS X
|
|
|
14
14
|
Classifier: Topic :: Software Development :: Testing
|
|
15
15
|
Classifier: Topic :: Software Development :: Libraries
|
|
16
16
|
Classifier: Topic :: Utilities
|
|
17
|
-
Classifier: Programming Language :: Python :: 2
|
|
18
17
|
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
21
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
21
|
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
-
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
23
|
+
Requires-Python: >=3.11
|
|
26
24
|
Description-Content-Type: text/x-rst
|
|
27
25
|
License-File: LICENSE.txt
|
|
28
26
|
License-File: AUTHORS.rst
|
|
@@ -30,6 +28,8 @@ Requires-Dist: requests
|
|
|
30
28
|
Requires-Dist: psutil
|
|
31
29
|
Requires-Dist: pytest
|
|
32
30
|
Requires-Dist: zc.lockfile>=2.0
|
|
31
|
+
Provides-Extra: memcached
|
|
32
|
+
Requires-Dist: pylibmc; extra == "memcached"
|
|
33
33
|
Dynamic: author
|
|
34
34
|
Dynamic: author-email
|
|
35
35
|
Dynamic: classifier
|
|
@@ -38,6 +38,7 @@ Dynamic: description-content-type
|
|
|
38
38
|
Dynamic: home-page
|
|
39
39
|
Dynamic: license
|
|
40
40
|
Dynamic: license-file
|
|
41
|
+
Dynamic: provides-extra
|
|
41
42
|
Dynamic: requires-dist
|
|
42
43
|
Dynamic: requires-python
|
|
43
44
|
Dynamic: summary
|
|
@@ -287,6 +288,15 @@ These people have contributed to `pytest-services`, in alphabetical order:
|
|
|
287
288
|
Changelog
|
|
288
289
|
=========
|
|
289
290
|
|
|
291
|
+
2.3.0
|
|
292
|
+
-----
|
|
293
|
+
|
|
294
|
+
- #57: Dropped support for Python 3.9 and 3.10; Python 3.11+ is now required.
|
|
295
|
+
- #57: Added official support for Python 3.15.
|
|
296
|
+
- #57: Fixed the ``memcached`` extra, which was silently ignored: ``pip install pytest-services[memcached]`` now installs ``pylibmc``.
|
|
297
|
+
- #55: Use ``pytest.fixture`` instead of the deprecated ``pytest.yield_fixture``, which warns with ``PytestRemovedIn10Warning`` on pytest 9.
|
|
298
|
+
- #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.
|
|
299
|
+
|
|
290
300
|
2.2.2
|
|
291
301
|
-----
|
|
292
302
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"""Sphinx config."""
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
#
|
|
4
3
|
# pytest-services documentation build configuration file, created by
|
|
5
4
|
# sphinx-quickstart on Sun Apr 7 21:07:56 2013.
|
|
@@ -45,9 +44,9 @@ source_suffix = '.rst'
|
|
|
45
44
|
master_doc = 'index'
|
|
46
45
|
|
|
47
46
|
# General information about the project.
|
|
48
|
-
project =
|
|
47
|
+
project = 'pytest-services'
|
|
49
48
|
AUTHOR = 'Anatoly Bubenkov, Paylogic International and others'
|
|
50
|
-
copyright =
|
|
49
|
+
copyright = '2015, ' + AUTHOR
|
|
51
50
|
|
|
52
51
|
# The version info for the project you're documenting, acts as replacement for
|
|
53
52
|
# |version| and |release|, also used in various other places throughout the
|
|
@@ -189,7 +188,7 @@ latex_elements = {
|
|
|
189
188
|
# Grouping the document tree into LaTeX files. List of tuples
|
|
190
189
|
# (source start file, target name, title, author, documentclass [howto/manual]).
|
|
191
190
|
latex_documents = [
|
|
192
|
-
('index', 'pytest-services.tex',
|
|
191
|
+
('index', 'pytest-services.tex', 'pytest-services Documentation', AUTHOR, 'manual'),
|
|
193
192
|
]
|
|
194
193
|
|
|
195
194
|
# The name of an image file (relative to this directory) to place at the top of
|
|
@@ -218,7 +217,7 @@ latex_documents = [
|
|
|
218
217
|
# One entry per manual page. List of tuples
|
|
219
218
|
# (source start file, name, description, authors, manual section).
|
|
220
219
|
man_pages = [
|
|
221
|
-
('index', 'pytest-services',
|
|
220
|
+
('index', 'pytest-services', 'pytest-services Documentation',
|
|
222
221
|
[AUTHOR], 1)
|
|
223
222
|
]
|
|
224
223
|
|
|
@@ -232,7 +231,7 @@ man_pages = [
|
|
|
232
231
|
# (source start file, target name, title, author,
|
|
233
232
|
# dir menu entry, description, category)
|
|
234
233
|
texinfo_documents = [
|
|
235
|
-
('index', 'pytest-services',
|
|
234
|
+
('index', 'pytest-services', 'pytest-services Documentation',
|
|
236
235
|
AUTHOR, 'pytest-services', 'Services plugin for pytest testing framework.',
|
|
237
236
|
'Miscellaneous'),
|
|
238
237
|
]
|
|
@@ -12,7 +12,7 @@ def root_dir():
|
|
|
12
12
|
return '/tmp'
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
@pytest.
|
|
15
|
+
@pytest.fixture(scope='session')
|
|
16
16
|
def base_dir(request, session_id, root_dir, services_log):
|
|
17
17
|
"""The directory where test run artifacts should be stored.
|
|
18
18
|
|
|
@@ -20,14 +20,14 @@ def base_dir(request, session_id, root_dir, services_log):
|
|
|
20
20
|
after themselves.
|
|
21
21
|
|
|
22
22
|
"""
|
|
23
|
-
path = os.path.join(root_dir, 'sr-{
|
|
24
|
-
services_log.debug('creating base dir: {
|
|
23
|
+
path = os.path.join(root_dir, f'sr-{session_id}')
|
|
24
|
+
services_log.debug(f'creating base dir: {path}')
|
|
25
25
|
if not os.path.exists(path):
|
|
26
26
|
os.mkdir(path)
|
|
27
27
|
|
|
28
28
|
yield path
|
|
29
29
|
|
|
30
|
-
services_log.debug('finalizing base dir: {
|
|
30
|
+
services_log.debug(f'finalizing base dir: {path}')
|
|
31
31
|
shutil.rmtree(path, ignore_errors=True)
|
|
32
32
|
|
|
33
33
|
|
|
@@ -36,7 +36,7 @@ def temp_dir(request, base_dir, services_log):
|
|
|
36
36
|
"""The temporary dir."""
|
|
37
37
|
path = os.path.join(base_dir, 'tmp')
|
|
38
38
|
|
|
39
|
-
services_log.debug('creating temp dir: {
|
|
39
|
+
services_log.debug(f'creating temp dir: {path}')
|
|
40
40
|
if not os.path.exists(path):
|
|
41
41
|
os.mkdir(path)
|
|
42
42
|
|
|
@@ -52,7 +52,7 @@ def memory_root_dir(root_dir):
|
|
|
52
52
|
return root_dir
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
@pytest.
|
|
55
|
+
@pytest.fixture(scope='session')
|
|
56
56
|
def memory_base_dir(request, session_id, memory_root_dir, services_log):
|
|
57
57
|
"""The directory where memory test run artifacts should be stored.
|
|
58
58
|
|
|
@@ -60,15 +60,15 @@ def memory_base_dir(request, session_id, memory_root_dir, services_log):
|
|
|
60
60
|
after themselves.
|
|
61
61
|
|
|
62
62
|
"""
|
|
63
|
-
path = os.path.join(memory_root_dir, 'sr-{
|
|
63
|
+
path = os.path.join(memory_root_dir, f'sr-{session_id}')
|
|
64
64
|
|
|
65
|
-
services_log.debug('creating memory base dir: {
|
|
65
|
+
services_log.debug(f'creating memory base dir: {path}')
|
|
66
66
|
if not os.path.exists(path):
|
|
67
67
|
os.mkdir(path)
|
|
68
68
|
|
|
69
69
|
yield path
|
|
70
70
|
|
|
71
|
-
services_log.debug('finalizing memory base dir: {
|
|
71
|
+
services_log.debug(f'finalizing memory base dir: {path}')
|
|
72
72
|
shutil.rmtree(path, ignore_errors=True)
|
|
73
73
|
|
|
74
74
|
|
|
@@ -77,7 +77,7 @@ def memory_temp_dir(request, memory_base_dir, services_log):
|
|
|
77
77
|
"""The memory temporary dir."""
|
|
78
78
|
path = os.path.join(memory_base_dir, 'tmp')
|
|
79
79
|
|
|
80
|
-
services_log.debug('creating memory temp dir: {
|
|
80
|
+
services_log.debug(f'creating memory temp dir: {path}')
|
|
81
81
|
if not os.path.exists(path):
|
|
82
82
|
os.mkdir(path)
|
|
83
83
|
|
|
@@ -88,7 +88,7 @@ def memory_temp_dir(request, memory_base_dir, services_log):
|
|
|
88
88
|
def lock_dir(memory_root_dir, services_log):
|
|
89
89
|
"""The lock dir."""
|
|
90
90
|
path = os.path.join(memory_root_dir, 'service-locks')
|
|
91
|
-
services_log.debug('ensuring lock dir: {
|
|
91
|
+
services_log.debug(f'ensuring lock dir: {path}')
|
|
92
92
|
if not os.path.exists(path):
|
|
93
93
|
try:
|
|
94
94
|
os.mkdir(path, 0o777)
|
|
@@ -108,7 +108,7 @@ def lock_dir(memory_root_dir, services_log):
|
|
|
108
108
|
def run_dir(memory_temp_dir, services_log):
|
|
109
109
|
"""The run dir (like local /var/run)."""
|
|
110
110
|
path = os.path.join(memory_temp_dir, 'run')
|
|
111
|
-
services_log.debug('creating run dir: {
|
|
111
|
+
services_log.debug(f'creating run dir: {path}')
|
|
112
112
|
os.mkdir(path)
|
|
113
113
|
|
|
114
114
|
return path
|
|
@@ -55,8 +55,8 @@ def unlock_resource(name, resource, lock_dir, services_log):
|
|
|
55
55
|
bound_resources.remove(resource)
|
|
56
56
|
except ValueError:
|
|
57
57
|
pass
|
|
58
|
-
services_log.debug('resource freed {
|
|
59
|
-
services_log.debug('bound resources {
|
|
58
|
+
services_log.debug(f'resource freed {name}: {resource}')
|
|
59
|
+
services_log.debug(f'bound resources {name}: {bound_resources}')
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
@contextlib.contextmanager
|
|
@@ -105,20 +105,20 @@ def lock_resource(name, resource_getter, lock_dir, services_log, lock_resource_t
|
|
|
105
105
|
while True:
|
|
106
106
|
try:
|
|
107
107
|
with locked_resources(name, lock_dir) as bound_resources:
|
|
108
|
-
services_log.debug('bound_resources {
|
|
108
|
+
services_log.debug(f'bound_resources {name}: {bound_resources}')
|
|
109
109
|
resource = resource_getter(bound_resources)
|
|
110
110
|
while resource in bound_resources:
|
|
111
111
|
# resource is already taken by someone, retry
|
|
112
|
-
services_log.debug('bound resources {
|
|
112
|
+
services_log.debug(f'bound resources {name}: {bound_resources}')
|
|
113
113
|
resource = resource_getter(bound_resources)
|
|
114
|
-
services_log.debug('free resource choosen {
|
|
114
|
+
services_log.debug(f'free resource choosen {name}: {resource}')
|
|
115
115
|
bound_resources.append(resource)
|
|
116
|
-
services_log.debug('bound resources {
|
|
116
|
+
services_log.debug(f'bound resources {name}: {bound_resources}')
|
|
117
117
|
return resource
|
|
118
118
|
except zc.lockfile.LockError as err:
|
|
119
119
|
if total_seconds_slept >= lock_resource_timeout:
|
|
120
120
|
raise err
|
|
121
|
-
services_log.debug('lock resource failed: {
|
|
121
|
+
services_log.debug(f'lock resource failed: {err}')
|
|
122
122
|
|
|
123
123
|
seconds_to_sleep = random() * 0.1 + 0.05
|
|
124
124
|
total_seconds_slept += seconds_to_sleep
|
|
@@ -139,7 +139,7 @@ def get_free_port(lock_dir, services_log, lock_resource_timeout):
|
|
|
139
139
|
s.bind(('127.0.0.1', port))
|
|
140
140
|
s.close()
|
|
141
141
|
return port
|
|
142
|
-
except
|
|
142
|
+
except OSError:
|
|
143
143
|
pass
|
|
144
144
|
port += 1
|
|
145
145
|
|
|
@@ -153,7 +153,7 @@ def get_free_display(lock_dir, services_log, lock_resource_timeout):
|
|
|
153
153
|
while True:
|
|
154
154
|
if bound_resources:
|
|
155
155
|
display = max(bound_resources) + 1
|
|
156
|
-
if os.path.exists('/tmp/.X{
|
|
156
|
+
if os.path.exists(f'/tmp/.X{display}-lock'):
|
|
157
157
|
display += 1
|
|
158
158
|
continue
|
|
159
159
|
return display
|
|
@@ -16,9 +16,9 @@ def services_log(worker_id):
|
|
|
16
16
|
handler = logging.handlers.SysLogHandler(
|
|
17
17
|
facility=logging.handlers.SysLogHandler.LOG_LOCAL7, address='/dev/log', **kwargs)
|
|
18
18
|
break
|
|
19
|
-
except (
|
|
19
|
+
except (OSError, TypeError):
|
|
20
20
|
pass
|
|
21
|
-
logger = logging.getLogger('[{worker_id}] {
|
|
21
|
+
logger = logging.getLogger(f'[{worker_id}] {__name__}')
|
|
22
22
|
logger.setLevel(logging.DEBUG)
|
|
23
23
|
if handler and workaround_issue_20(handler):
|
|
24
24
|
logger.propagate = 0
|
|
@@ -26,7 +26,7 @@ def memcached(request, run_services, memcached_socket, watcher_getter):
|
|
|
26
26
|
def memcached_connection(run_services, memcached_socket):
|
|
27
27
|
"""The connection string to the local memcached instance."""
|
|
28
28
|
if run_services:
|
|
29
|
-
return 'unix:{
|
|
29
|
+
return f'unix:{memcached_socket}'
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
@pytest.fixture
|
|
@@ -63,11 +63,11 @@ def mysql_system_database(
|
|
|
63
63
|
services_log.debug('Starting mysqld.')
|
|
64
64
|
check_output([
|
|
65
65
|
mysqld,
|
|
66
|
-
'--defaults-file={
|
|
66
|
+
f'--defaults-file={mysql_defaults_file}',
|
|
67
67
|
'--initialize-insecure',
|
|
68
|
-
'--datadir={
|
|
69
|
-
'--basedir={
|
|
70
|
-
'--user={
|
|
68
|
+
f'--datadir={mysql_data_dir}',
|
|
69
|
+
f'--basedir={mysql_base_dir}',
|
|
70
|
+
'--user={}'.format(os.environ['USER'])
|
|
71
71
|
])
|
|
72
72
|
except CalledProcessWithOutputError as e:
|
|
73
73
|
services_log.error(
|
|
@@ -88,7 +88,7 @@ def mysql_data_dir(
|
|
|
88
88
|
"""
|
|
89
89
|
if run_services:
|
|
90
90
|
path = os.path.join(memory_base_dir, 'mysql')
|
|
91
|
-
services_log.debug('Making mysql base dir in {path}'
|
|
91
|
+
services_log.debug(f'Making mysql base dir in {path}')
|
|
92
92
|
|
|
93
93
|
def finalizer():
|
|
94
94
|
shutil.rmtree(path, ignore_errors=True)
|
|
@@ -115,7 +115,7 @@ def mysql_pid(run_dir):
|
|
|
115
115
|
def mysql_connection(run_services, mysql_socket):
|
|
116
116
|
"""The connection string to the local mysql instance."""
|
|
117
117
|
if run_services:
|
|
118
|
-
return 'mysql://root@localhost/?unix_socket={
|
|
118
|
+
return f'mysql://root@localhost/?unix_socket={mysql_socket}&charset=utf8'
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
@pytest.fixture(scope='session')
|
|
@@ -127,10 +127,10 @@ def mysql_watcher(
|
|
|
127
127
|
return watcher_getter(
|
|
128
128
|
'mysqld',
|
|
129
129
|
[
|
|
130
|
-
'--defaults-file={
|
|
131
|
-
'--datadir={mysql_data_dir}'
|
|
132
|
-
'--pid-file={mysql_pid}'
|
|
133
|
-
'--socket={mysql_socket}'
|
|
130
|
+
f'--defaults-file={mysql_defaults_file}',
|
|
131
|
+
f'--datadir={mysql_data_dir}',
|
|
132
|
+
f'--pid-file={mysql_pid}',
|
|
133
|
+
f'--socket={mysql_socket}',
|
|
134
134
|
'--skip-networking',
|
|
135
135
|
],
|
|
136
136
|
checker=lambda: os.path.exists(mysql_socket),
|
|
@@ -153,12 +153,12 @@ def mysql_database_getter(run_services, mysql_watcher, mysql_socket):
|
|
|
153
153
|
[
|
|
154
154
|
'mysql',
|
|
155
155
|
'--user=root',
|
|
156
|
-
'--socket={
|
|
157
|
-
'--execute=create database {
|
|
156
|
+
f'--socket={mysql_socket}',
|
|
157
|
+
f'--execute=create database {database_name};',
|
|
158
158
|
],
|
|
159
159
|
)
|
|
160
160
|
check_output(
|
|
161
|
-
'mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql --user=root --socket={
|
|
161
|
+
f'mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql --user=root --socket={mysql_socket} mysql',
|
|
162
162
|
shell=True
|
|
163
163
|
)
|
|
164
164
|
return getter
|
|
@@ -37,12 +37,12 @@ class CalledProcessWithOutputError(subprocess.CalledProcessError):
|
|
|
37
37
|
|
|
38
38
|
def __init__(self, returncode, cmd, output, err):
|
|
39
39
|
"""Assign output and error."""
|
|
40
|
-
super(
|
|
40
|
+
super().__init__(returncode, cmd)
|
|
41
41
|
|
|
42
42
|
self.output = output
|
|
43
43
|
self.err = err
|
|
44
44
|
|
|
45
45
|
def __str__(self):
|
|
46
46
|
"""str representation."""
|
|
47
|
-
return super(
|
|
47
|
+
return super().__str__() + ' with output: {} and error: {}'.format(
|
|
48
48
|
self.output, self.err)
|
|
@@ -71,11 +71,11 @@ def watcher_getter(request, services_log):
|
|
|
71
71
|
warnings.warn('Omitting the `request` parameter will result in an unstable order of finalizers.')
|
|
72
72
|
request = orig_request
|
|
73
73
|
executable = which(name)
|
|
74
|
-
assert executable, 'You have to install {
|
|
74
|
+
assert executable, f'You have to install {name} executable.'
|
|
75
75
|
|
|
76
76
|
cmd = [name] + (arguments or [])
|
|
77
77
|
|
|
78
|
-
services_log.debug('Starting {
|
|
78
|
+
services_log.debug(f'Starting {name}: {arguments}')
|
|
79
79
|
|
|
80
80
|
watcher = subprocess.Popen(
|
|
81
81
|
cmd, **(kwargs or {}))
|
|
@@ -97,10 +97,10 @@ def watcher_getter(request, services_log):
|
|
|
97
97
|
times = 0
|
|
98
98
|
while not checker():
|
|
99
99
|
if watcher.returncode is not None:
|
|
100
|
-
raise Exception("Error running {
|
|
100
|
+
raise Exception(f"Error running {name}")
|
|
101
101
|
|
|
102
102
|
if times > timeout:
|
|
103
|
-
raise Exception('The {
|
|
103
|
+
raise Exception(f'The {name} service checked did not succeed!')
|
|
104
104
|
|
|
105
105
|
time.sleep(1)
|
|
106
106
|
times += 1
|
|
@@ -46,7 +46,7 @@ def xvfb_display(request, run_services, lock_dir, services_log, display_getter):
|
|
|
46
46
|
display = request.config.option.display
|
|
47
47
|
else:
|
|
48
48
|
display = display_getter()
|
|
49
|
-
os.environ['DISPLAY'] = ':{
|
|
49
|
+
os.environ['DISPLAY'] = f':{display}' if ':' not in str(display) else display
|
|
50
50
|
|
|
51
51
|
return display
|
|
52
52
|
|
|
@@ -69,19 +69,19 @@ def xvfb(request, run_services, xvfb_display, lock_dir, xvfb_resolution, watcher
|
|
|
69
69
|
else:
|
|
70
70
|
listen_args = []
|
|
71
71
|
|
|
72
|
-
with file_lock(os.path.join(lock_dir, 'xvfb_{
|
|
72
|
+
with file_lock(os.path.join(lock_dir, f'xvfb_{xvfb_display}.lock'),
|
|
73
73
|
):
|
|
74
74
|
|
|
75
75
|
def checker():
|
|
76
76
|
try:
|
|
77
77
|
socket.create_connection(('127.0.0.1', 6000 + xvfb_display))
|
|
78
78
|
return True
|
|
79
|
-
except
|
|
79
|
+
except OSError:
|
|
80
80
|
pass
|
|
81
81
|
|
|
82
82
|
return watcher_getter(
|
|
83
83
|
'Xvfb', [
|
|
84
|
-
':{
|
|
84
|
+
f':{xvfb_display}',
|
|
85
85
|
'-screen',
|
|
86
86
|
'0',
|
|
87
87
|
'x'.join(str(value) for value in xvfb_resolution),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pytest-services
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Services plugin for pytest testing framework
|
|
5
5
|
Home-page: https://github.com/pytest-dev/pytest-services
|
|
6
6
|
Author: Anatoly Bubenkov, Paylogic International and others
|
|
@@ -14,15 +14,13 @@ Classifier: Operating System :: MacOS :: MacOS X
|
|
|
14
14
|
Classifier: Topic :: Software Development :: Testing
|
|
15
15
|
Classifier: Topic :: Software Development :: Libraries
|
|
16
16
|
Classifier: Topic :: Utilities
|
|
17
|
-
Classifier: Programming Language :: Python :: 2
|
|
18
17
|
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
21
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
21
|
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
-
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
23
|
+
Requires-Python: >=3.11
|
|
26
24
|
Description-Content-Type: text/x-rst
|
|
27
25
|
License-File: LICENSE.txt
|
|
28
26
|
License-File: AUTHORS.rst
|
|
@@ -30,6 +28,8 @@ Requires-Dist: requests
|
|
|
30
28
|
Requires-Dist: psutil
|
|
31
29
|
Requires-Dist: pytest
|
|
32
30
|
Requires-Dist: zc.lockfile>=2.0
|
|
31
|
+
Provides-Extra: memcached
|
|
32
|
+
Requires-Dist: pylibmc; extra == "memcached"
|
|
33
33
|
Dynamic: author
|
|
34
34
|
Dynamic: author-email
|
|
35
35
|
Dynamic: classifier
|
|
@@ -38,6 +38,7 @@ Dynamic: description-content-type
|
|
|
38
38
|
Dynamic: home-page
|
|
39
39
|
Dynamic: license
|
|
40
40
|
Dynamic: license-file
|
|
41
|
+
Dynamic: provides-extra
|
|
41
42
|
Dynamic: requires-dist
|
|
42
43
|
Dynamic: requires-python
|
|
43
44
|
Dynamic: summary
|
|
@@ -287,6 +288,15 @@ These people have contributed to `pytest-services`, in alphabetical order:
|
|
|
287
288
|
Changelog
|
|
288
289
|
=========
|
|
289
290
|
|
|
291
|
+
2.3.0
|
|
292
|
+
-----
|
|
293
|
+
|
|
294
|
+
- #57: Dropped support for Python 3.9 and 3.10; Python 3.11+ is now required.
|
|
295
|
+
- #57: Added official support for Python 3.15.
|
|
296
|
+
- #57: Fixed the ``memcached`` extra, which was silently ignored: ``pip install pytest-services[memcached]`` now installs ``pylibmc``.
|
|
297
|
+
- #55: Use ``pytest.fixture`` instead of the deprecated ``pytest.yield_fixture``, which warns with ``PytestRemovedIn10Warning`` on pytest 9.
|
|
298
|
+
- #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.
|
|
299
|
+
|
|
290
300
|
2.2.2
|
|
291
301
|
-----
|
|
292
302
|
|
|
@@ -33,6 +33,7 @@ pytest_services.egg-info/SOURCES.txt
|
|
|
33
33
|
pytest_services.egg-info/dependency_links.txt
|
|
34
34
|
pytest_services.egg-info/entry_points.txt
|
|
35
35
|
pytest_services.egg-info/requires.txt
|
|
36
|
+
pytest_services.egg-info/scm_file_list.json
|
|
36
37
|
pytest_services.egg-info/top_level.txt
|
|
37
38
|
tests/__init__.py
|
|
38
39
|
tests/conftest.py
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
".coveragerc",
|
|
4
|
+
".github/workflows/deploy.yml",
|
|
5
|
+
".github/workflows/test.yml",
|
|
6
|
+
".gitignore",
|
|
7
|
+
".readthedocs.yaml",
|
|
8
|
+
"AUTHORS.rst",
|
|
9
|
+
"CHANGES.rst",
|
|
10
|
+
"LICENSE.txt",
|
|
11
|
+
"README.rst",
|
|
12
|
+
"RELEASING.rst",
|
|
13
|
+
"docs/Makefile",
|
|
14
|
+
"docs/api/index.rst",
|
|
15
|
+
"docs/conf.py",
|
|
16
|
+
"docs/index.rst",
|
|
17
|
+
"pyproject.toml",
|
|
18
|
+
"pytest_services/__init__.py",
|
|
19
|
+
"pytest_services/django_settings.py",
|
|
20
|
+
"pytest_services/folders.py",
|
|
21
|
+
"pytest_services/gui.py.orig",
|
|
22
|
+
"pytest_services/locks.py",
|
|
23
|
+
"pytest_services/log.py",
|
|
24
|
+
"pytest_services/memcached.py",
|
|
25
|
+
"pytest_services/mysql.py",
|
|
26
|
+
"pytest_services/plugin.py",
|
|
27
|
+
"pytest_services/process.py",
|
|
28
|
+
"pytest_services/service.py",
|
|
29
|
+
"pytest_services/xvfb.py",
|
|
30
|
+
"requirements-testing.txt",
|
|
31
|
+
"setup.py",
|
|
32
|
+
"tests/__init__.py",
|
|
33
|
+
"tests/conftest.py",
|
|
34
|
+
"tests/test_plugin.py",
|
|
35
|
+
"tox.ini"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -27,10 +27,10 @@ setup(
|
|
|
27
27
|
license='MIT',
|
|
28
28
|
author_email='bubenkoff@gmail.com',
|
|
29
29
|
url='https://github.com/pytest-dev/pytest-services',
|
|
30
|
-
|
|
30
|
+
extras_require={
|
|
31
31
|
'memcached': ['pylibmc'],
|
|
32
32
|
},
|
|
33
|
-
python_requires=">=3.
|
|
33
|
+
python_requires=">=3.11",
|
|
34
34
|
install_requires=install_requires,
|
|
35
35
|
classifiers=[
|
|
36
36
|
'Development Status :: 6 - Mature',
|
|
@@ -41,14 +41,12 @@ setup(
|
|
|
41
41
|
'Topic :: Software Development :: Testing',
|
|
42
42
|
'Topic :: Software Development :: Libraries',
|
|
43
43
|
'Topic :: Utilities',
|
|
44
|
-
'Programming Language :: Python :: 2',
|
|
45
44
|
'Programming Language :: Python :: 3',
|
|
46
|
-
'Programming Language :: Python :: 3.9',
|
|
47
|
-
'Programming Language :: Python :: 3.10',
|
|
48
45
|
'Programming Language :: Python :: 3.11',
|
|
49
46
|
'Programming Language :: Python :: 3.12',
|
|
50
47
|
'Programming Language :: Python :: 3.13',
|
|
51
48
|
'Programming Language :: Python :: 3.14',
|
|
49
|
+
'Programming Language :: Python :: 3.15',
|
|
52
50
|
],
|
|
53
51
|
tests_require=['tox'],
|
|
54
52
|
entry_points={'pytest11': [
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
import os.path
|
|
3
3
|
import socket
|
|
4
4
|
|
|
5
|
-
import pylibmc
|
|
6
|
-
import MySQLdb
|
|
7
|
-
|
|
8
5
|
|
|
9
6
|
def test_memcached(request, memcached, memcached_socket):
|
|
10
7
|
"""Test memcached service."""
|
|
8
|
+
import pylibmc
|
|
9
|
+
|
|
11
10
|
mc = pylibmc.Client([memcached_socket])
|
|
12
11
|
mc.set('some', 1)
|
|
13
12
|
assert mc.get('some') == 1
|
|
@@ -19,6 +18,8 @@ def test_memcached(request, memcached, memcached_socket):
|
|
|
19
18
|
|
|
20
19
|
def test_mysql(mysql, mysql_connection, mysql_socket):
|
|
21
20
|
"""Test mysql service."""
|
|
21
|
+
import MySQLdb
|
|
22
|
+
|
|
22
23
|
conn = MySQLdb.connect(user='root', unix_socket=mysql_socket)
|
|
23
24
|
assert conn
|
|
24
25
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tox]
|
|
2
2
|
envlist=
|
|
3
|
-
py{
|
|
3
|
+
py{311,312,313,314,315}
|
|
4
4
|
py-xdist
|
|
5
5
|
|
|
6
6
|
[testenv]
|
|
@@ -10,7 +10,6 @@ commands=
|
|
|
10
10
|
deps =
|
|
11
11
|
xdist: pytest-xdist
|
|
12
12
|
-r{toxinidir}/requirements-testing.txt
|
|
13
|
-
extras = memcache
|
|
14
13
|
passenv = USER
|
|
15
14
|
|
|
16
15
|
[pytest]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytest_services-2.2.2 → pytest_services-2.3.0}/pytest_services.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|