Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytest7 compatibility #354

Merged
merged 4 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ packages = find:
package_dir =
=src
install_requires =
pytest
pytest >= 6.2
port-for >= 0.6.0
mirakuru
mysqlclient
Expand Down
12 changes: 7 additions & 5 deletions src/pytest_mysql/factories/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"""Process fixture factory for MySQL database."""

import os
import py
from warnings import warn

import pytest
from _pytest.fixtures import FixtureRequest
from _pytest.tmpdir import TempdirFactory
from pytest import FixtureRequest, TempPathFactory
from port_for import get_port

from pytest_mysql.config import get_config
Expand Down Expand Up @@ -64,7 +64,7 @@ def mysql_proc(

@pytest.fixture(scope="session")
def mysql_proc_fixture(
request: FixtureRequest, tmpdir_factory: TempdirFactory
request: FixtureRequest, tmp_path_factory: TempPathFactory
):
"""
Process fixture for MySQL server.
Expand All @@ -77,7 +77,7 @@ def mysql_proc_fixture(
`See <https://dev.mysql.com/doc/refman/5.6/en/mysqladmin.html>`_

:param FixtureRequest request: fixture request object
:param tmpdir_factory: pytest fixture for temporary directories
:param tmp_path_factory: pytest fixture for temporary directories
:rtype: pytest_dbfixtures.executors.TCPExecutor
:returns: tcp executor

Expand All @@ -91,7 +91,9 @@ def mysql_proc_fixture(
mysql_params = params or config["params"]
mysql_install_db = install_db or config["install_db"]

tmpdir = tmpdir_factory.mktemp(f"pytest-mysql-{request.fixturename}")
tmpdir = py.path.local(
tmp_path_factory.mktemp(f"pytest-mysql-{request.fixturename}")
)

if logs_prefix:
warn(
Expand Down