Skip to content

chore(deps-dev): update all dev deps #268

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

Merged
merged 1 commit into from
Jun 15, 2025
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 CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All contributions are greatly appreciated! Before contributing, please read the

This project uses [Poetry][] to manage dependencies and builds, and you will need to install it before working on Decoy.

Once Poetry is installed, you should be good to set up a virtual environment and install development dependencies. Python 3.11 is recommended for development.
Once Poetry is installed, you should be good to set up a virtual environment and install development dependencies. Python >=3.10 is recommended for development.

```bash
git clone https://github.com/mcous/decoy.git
Expand Down
2 changes: 1 addition & 1 deletion decoy/warning_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _check_no_redundant_verify(all_calls: Sequence[AnySpyEvent]) -> None:
verify_rehearsals = [c for c in all_calls if isinstance(c, VerifyRehearsal)]

for vr in verify_rehearsals:
if any(wr for wr in when_rehearsals if wr == vr):
if any(wr for wr in when_rehearsals if wr == vr): # type: ignore[comparison-overlap]
_warn(RedundantVerifyWarning(rehearsal=vr))


Expand Down
2 changes: 1 addition & 1 deletion docs/usage/errors-and-warnings.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ E AssertionError: assert None == 'good job'

The test failed, which is good! But, the developer's next steps to fix the error aren't immediately obvious.

Your first reaction, especially if you're coming from a mocking library like [unittest.mock][], might be "We need to add an assertion that `data_getter.get` was called correctly." This would be bad, though! See [RedundantVerifyWarning](#RedundantVerifyWarning) below for why adding an assertion like this would be redundant and potentially harmful.
Your first reaction, especially if you're coming from a mocking library like [unittest.mock][], might be "We need to add an assertion that `data_getter.get` was called correctly." This would be bad, though! See [RedundantVerifyWarning](#redundantverifywarning) below for why adding an assertion like this would be redundant and potentially harmful.

Even if we shouldn't add an assertion, we still want something to help us find the underlying issue. This is where `MiscalledStubWarning` comes in. When this test is run, Decoy will print the following warnings:

Expand Down
2,422 changes: 1,896 additions & 526 deletions poetry.lock

Large diffs are not rendered by default.

53 changes: 42 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,55 @@ classifiers = [
python = "^3.7"

[tool.poetry.group.dev.dependencies]
poethepoet = "0.19.0"
poethepoet = [
{ version = "0.19.0", python = "<3.8" },
{ version = "0.30.0", python = ">=3.8, <3.9" },
{ version = "0.35.0", python = ">=3.9" },
]

[tool.poetry.group.test.dependencies]
coverage = { version = "7.2.7", extras = ["toml"] }
coverage = [
{ version = "7.2.7", extras = [
"toml",
], python = "<3.8" },
{ version = "7.6.1", extras = [
"toml",
], python = ">=3.8, <3.9" },
{ version = "7.9.1", extras = [
"toml",
], python = ">=3.9" },
]
mypy = [
{ version = "1.4.1", python = "<3.8" },
{ version = "1.5.0", python = ">=3.8" },
{ version = "1.14.1", python = ">=3.8, <3.9" },
{ version = "1.16.0", python = ">=3.9" },
]
pytest = [
{ version = "7.4.4", python = "<3.8" },
{ version = "8.3.5", python = ">=3.8, <3.9" },
{ version = "8.4.0", python = ">=3.9" },
]
pytest-asyncio = [
{ version = "0.21.2", python = "<3.8" },
{ version = "0.24.0", python = ">=3.8, <3.9" },
{ version = "1.0.0", python = ">=3.9" },
]
pytest-mypy-plugins = [
{ version = "2.0.0", python = "<3.8" },
{ version = "3.1.2", python = ">=3.8, <3.9" },
{ version = "3.2.0", python = ">=3.9" },
]
pytest-xdist = [
{ version = "3.5.0", python = "<3.8" },
{ version = "3.6.1", python = ">=3.8, <3.9" },
{ version = "3.7.0", python = ">=3.9" },
]
pytest = "7.4.0"
pytest-asyncio = "0.21.1"
pytest-mypy-plugins = "2.0.0"
pytest-xdist = "3.5.0"
ruff = "0.11.0"
ruff = "0.11.13"

[tool.poetry.group.docs.dependencies]
mkdocs = { version = "1.5.3", python = ">=3.8" }
mkdocs-material = { version = "9.4.8", python = ">=3.8" }
mkdocstrings = { version = "0.23.0", extras = ["python"], python = ">=3.8" }
mkdocs = { version = "1.6.1", python = ">=3.10" }
mkdocs-material = { version = "9.6.14", python = ">=3.10" }
mkdocstrings = { version = "0.29.1", extras = ["python"], python = ">=3.10" }

[tool.poe.tasks]
all = [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_decoy(decoy):
"""
)

result = testdir.runpytest()
result = testdir.runpytest_subprocess()

# check that all 4 tests passed
result.assert_outcomes(passed=1)
6 changes: 3 additions & 3 deletions tests/test_spy_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_push_and_consume_when_rehearsal() -> None:
result = subject.consume_when_rehearsal(ignore_extra_args=False)

assert isinstance(result, WhenRehearsal)
assert call == result
assert call == result # type: ignore[comparison-overlap]


def test_push_and_consume_when_rehearsal_ignore_extra_args() -> None:
Expand Down Expand Up @@ -58,7 +58,7 @@ def test_push_and_consume_prop_rehearsal_for_when() -> None:
subject.push(event)
result = subject.consume_when_rehearsal(ignore_extra_args=False)
assert isinstance(result, WhenRehearsal)
assert result == event
assert result == event # type: ignore[comparison-overlap]


def test_consume_when_rehearsal_raises_empty_error() -> None:
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_push_and_consume_prop_rehearsal_for_prop() -> None:
subject.push(event)
result = subject.consume_prop_rehearsal()
assert isinstance(result, PropRehearsal)
assert result == event
assert result == event # type: ignore[comparison-overlap]


def test_consume_prop_rehearsal_raises_empty_error() -> None:
Expand Down
3 changes: 2 additions & 1 deletion tests/typing/test_mypy_plugin.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# mypy plugin tests

- case: does_not_suppress_func_returns_value
regex: yes
main: |
def noop() -> None:
pass

value = noop()
out: |
main:4: error: "noop" does not return a value [func-returns-value]
main:4: error: "noop" does not return a value .* \[func-returns-value]

- case: suppresses_func_returns_value_in_when
main: |
Expand Down
9 changes: 4 additions & 5 deletions tests/typing/test_typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
main:10: error: Argument 1 to "then_return" of "Stub" has incompatible type "str"; expected "int" [arg-type]

- case: context_manager_stub_mimics_enter_type
skip: sys.version_info < (3, 7)
main: |
import contextlib
from typing import Generator
Expand All @@ -94,7 +93,7 @@
main:13: error: Argument 1 to "then_enter_with" of "Stub" has incompatible type "str"; expected "int" [arg-type]

- case: context_manager_stub_rejects_wrong_spec
skip: sys.version_info < (3, 7)
regex: yes
main: |
from decoy import Decoy

Expand All @@ -109,10 +108,10 @@
decoy.when(fake_any("hello")).then_enter_with(42)

out: |
main:10: error: Invalid self argument "Stub[int]" to attribute function "then_enter_with" with type "Callable[[Stub[AbstractContextManager[ContextValueT]], ContextValueT], None]" [misc]
main:10: error: No overload variant of "then_enter_with" of "Stub" matches argument type "int" [call-overload]
main:10: error: Invalid self argument "Stub\[int]" to attribute function "then_enter_with" with type "Callable\[\[Stub\[.*ContextManager\[ContextValueT]], ContextValueT], None]" \[misc]
main:10: error: No overload variant of "then_enter_with" of "Stub" matches argument type "int" \[call-overload]
main:10: note: Possible overload variants:
main:10: note: def then_enter_with(self, value: <nothing>) -> None
main:10: note: def then_enter_with\(self, value.+\) -> None

- case: matchers_mimic_types
main: |
Expand Down
Loading