Skip to content

Commit

Permalink
Import pytest types from pytest package, not private _pytest - requir…
Browse files Browse the repository at this point in the history
…e at least pytest 6.2 - closes #533
  • Loading branch information
fizyk committed Feb 14, 2022
1 parent 6754aa5 commit 24a44fe
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests-macos.yml
Expand Up @@ -22,8 +22,8 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: [3.7, 3.8, 3.9, pypy-3.7-v7.3.3]
postgres-version: [11, 12, 13]
python-version: [3.7, 3.8, 3.9, "3.10", pypy-3.8-v7.3.7]
postgres-version: [12, 13, 14]
env:
OS: macos-latest
PYTHON: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Expand Up @@ -17,8 +17,8 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: [3.7, 3.8, 3.9, pypy-3.7-v7.3.3]
postgres-version: [9.6, 10, 11, 12, 13]
python-version: [3.7, 3.8, 3.9, "3.10", pypy-3.8-v7.3.7]
postgres-version: [10, 11, 12, 13, 14]
env:
OS: ubuntu-latest
PYTHON: ${{ matrix.python-version }}
Expand Down
12 changes: 12 additions & 0 deletions CHANGES.rst
@@ -1,6 +1,18 @@
CHANGELOG
=========

unreleased
----------

Cherry picked from v4.x

Misc
++++

- Import FixtureRequest, TempdirFactory from pytest, not private _pytest.
Require at least pytest 6.2
- Add Postgresql 14 to the CI

3.1.2
----------

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -34,7 +34,7 @@ packages = find:
package_dir =
=src
install_requires =
pytest>=3.0.0
pytest>=6.2.0
port-for
mirakuru>=2.3.0

Expand Down
2 changes: 1 addition & 1 deletion src/pytest_postgresql/config.py
@@ -1,4 +1,4 @@
from _pytest.fixtures import FixtureRequest
from pytest import FixtureRequest


def get_config(request: FixtureRequest) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_postgresql/factories/client.py
Expand Up @@ -19,7 +19,7 @@
from typing import List, Optional, Callable, Union

import pytest
from _pytest.fixtures import FixtureRequest
from pytest import FixtureRequest

from pytest_postgresql.compat import connection, check_for_psycopg2, psycopg2
from pytest_postgresql.config import get_config
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_postgresql/factories/noprocess.py
Expand Up @@ -19,7 +19,7 @@
from typing import Union, Callable, List, Iterator, Optional

import pytest
from _pytest.fixtures import FixtureRequest
from pytest import FixtureRequest

from pytest_postgresql.config import get_config
from pytest_postgresql.executor_noop import NoopExecutor
Expand Down
5 changes: 2 additions & 3 deletions src/pytest_postgresql/factories/process.py
Expand Up @@ -19,12 +19,11 @@
import os.path
import platform
import subprocess
from _warnings import warn
from typing import Union, Callable, List, Iterator, Optional, Tuple, Set
from warnings import warn

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

from pytest_postgresql.config import get_config
Expand Down
2 changes: 1 addition & 1 deletion tests/test_executor.py
Expand Up @@ -2,7 +2,7 @@
import sys
from typing import Any

from _pytest.fixtures import FixtureRequest
from pytest import FixtureRequest
from pkg_resources import parse_version

import psycopg2
Expand Down
2 changes: 1 addition & 1 deletion tests/test_postgres_options_plugin.py
@@ -1,6 +1,6 @@
"""Test behavior of postgres_options passed in different ways."""

from _pytest.pytester import Pytester
from pytest import Pytester


def test_postgres_options_config_in_cli(pytester: Pytester) -> None:
Expand Down

0 comments on commit 24a44fe

Please sign in to comment.