Skip to content

Commit f2c91c7

Browse files
feat: remove two-step-api exceptions
this is also a silly hacky excuse to yank 3.0.1. i accidentally included breaking changes in there due to a commit message that i failed to add the breaking changes footer to _and_ accidentally pushed directly to master. oops! anyway. BREAKING CHANGE: Not only will the two-step API not work anymore, but - **Python 3.7 is no longer supported** - code generation is a feature! - Render() and friends are a thing - cases try to deserialize input as json
1 parent e72a5db commit f2c91c7

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

pytest_embrace/embrace.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
from inspect import signature
66
from typing import Any, Callable, Generic
77
from typing import MutableMapping as TMutableMapping
8-
from typing import NoReturn, Type, TypeVar
8+
from typing import Type, TypeVar
99

1010
import pytest
1111
from typing_extensions import ParamSpec
1212

1313
from .case import CaseArtifact, CaseRunner, CaseType, CaseTypeInfo
14-
from .exc import CaseConfigurationError, TwoStepApiDeprecationError
14+
from .exc import CaseConfigurationError
1515

1616
RegistryValue = Type["CaseType"]
1717

@@ -72,12 +72,6 @@ def __init__(self, case_type: Type[CaseType], skip_validation: bool = False):
7272
self.fixture_name: str = ""
7373
self.skip_validation = skip_validation
7474

75-
def register_case_runner(self, *_: Any) -> NoReturn:
76-
raise TwoStepApiDeprecationError(deprecated_method="register_case_runner")
77-
78-
def caller_fixture_factory(self, *_: Any) -> NoReturn:
79-
raise TwoStepApiDeprecationError(deprecated_method="caller_fixture_factory")
80-
8175
def fixture(
8276
self, func: CaseRunner
8377
) -> Callable[[CaseType, pytest.FixtureRequest], Iterator[CaseArtifact[CaseType]]]:

pytest_embrace/exc.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import annotations
22

3-
from textwrap import dedent
4-
53

64
class EmbraceError(Exception):
75
"""Base for framework errors."""
@@ -11,22 +9,5 @@ class CaseConfigurationError(EmbraceError):
119
"""Raise at build/collection time."""
1210

1311

14-
class TwoStepApiDeprecationError(EmbraceError):
15-
"""Very specific error for methods deprecated after 3.0."""
16-
17-
def __init__(self, *, deprecated_method: str) -> None:
18-
msg = f"""
19-
`{deprecated_method}` is deprecated in favor of `Embrace.fixture`.
20-
The new API unifies the old two-step process into one.
21-
and requires very minimal code changes.
22-
23-
See migration guide in the docs:
24-
https://ainsleymcgrath.github.io/pytest-embrace/two-to-three/
25-
26-
In future releases, this method will completely removed."""
27-
28-
super().__init__(dedent(msg))
29-
30-
3112
class CodeGenError(EmbraceError):
3213
"""Raise when anything related to codegen goes awry."""

0 commit comments

Comments
 (0)