Skip to content

Commit

Permalink
chore(deps-dev): bump ruff from 0.0.276 to 0.0.284 (#216)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump ruff from 0.0.276 to 0.0.284

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.276 to 0.0.284.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](astral-sh/ruff@v0.0.276...v0.0.284)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fixup: lint fixes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Cousins <mike@cousins.io>
  • Loading branch information
dependabot[bot] and mcous committed Aug 13, 2023
1 parent 28a7a07 commit 1dc6abf
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 53 deletions.
2 changes: 1 addition & 1 deletion decoy/matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def __eq__(self, target: object) -> bool:
for key, value in self._values.items():
if is_match:
try:
is_match = key in target and target[key] == value # type: ignore[index,operator] # noqa: E501
is_match = key in target and target[key] == value # type: ignore[index,operator]
except TypeError:
is_match = False

Expand Down
5 changes: 1 addition & 4 deletions decoy/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ def verify(

for i in range(len(calls)):
calls_subset = calls[i : i + len(rehearsals)]
matches = [
match_event(c, r)
for c, r in zip(calls_subset, rehearsals) # noqa: B905
]
matches = [match_event(c, r) for c, r in zip(calls_subset, rehearsals)]

if all(matches) and len(calls_subset) == len(rehearsals):
match_count = match_count + 1
Expand Down
2 changes: 1 addition & 1 deletion decoy/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self, rehearsal: VerifyRehearsal) -> None:
"The same rehearsal was used in both a `when` and a `verify`.",
"This is redundant and probably a misuse of the mock.",
f"\t{stringify_call(rehearsal)}",
"See https://mike.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning", # noqa: E501
"See https://mike.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning",
]
)
super().__init__(message)
Expand Down
38 changes: 19 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 15 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@ pytest = "7.4.0"
pytest-asyncio = "0.21.1"
pytest-mypy-plugins = "2.0.0"
pytest-xdist = "3.3.1"
ruff = "0.0.276"
ruff = "0.0.284"

[tool.poe.tasks]
all = [ "check", "lint", "format-check", "test-once", "coverage", "docs-build", "build" ]
all = [
"check",
"lint",
"format-check",
"test-once",
"coverage",
"docs-build",
"build",
]
check = "mypy"
lint = "ruff check ."
format = "black ."
Expand All @@ -51,8 +59,8 @@ coverage-xml = "coverage xml"
docs = "mkdocs serve"
docs-build = "mkdocs build"
build = "poetry build"
check-ci = [ "check", "lint", "format-check" ]
test-ci = [ "test-once", "coverage-xml" ]
check-ci = ["check", "lint", "format-check"]
test-ci = ["test-once", "coverage-xml"]
build-ci = ["docs-build", "build"]

[tool.poetry.plugins."pytest11"]
Expand All @@ -72,22 +80,10 @@ show_error_codes = true
exclude_lines = ["@overload", "if TYPE_CHECKING:"]

[tool.ruff]
target-version = "py37"
extend-exclude = [".cache"]
ignore = [
"ANN101",
"ANN102",
"ANN401",
"D107",
]
select = [
"ANN",
"B",
"D",
"E",
"F",
"RUF",
"W",
]
select = ["ANN", "B", "D", "E", "F", "RUF", "W"]
ignore = ["ANN101", "ANN102", "ANN401", "D107", "E501"]

[tool.ruff.pydocstyle]
convention = "google"
Expand Down
16 changes: 8 additions & 8 deletions tests/test_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def goodbye(self) -> str:
def test_any_matcher() -> None:
"""It should have an "anything except None" matcher."""
assert 1 == matchers.Anything()
assert False == matchers.Anything() # noqa[E712]
assert False == matchers.Anything() # noqa: E712
assert {} == matchers.Anything()
assert [] == matchers.Anything()
assert ("hello", "world") == matchers.Anything()
Expand All @@ -30,7 +30,7 @@ def test_any_matcher() -> None:
def test_is_a_matcher() -> None:
"""It should have an "anything that is this type" matcher."""
assert 1 == matchers.IsA(int)
assert False == matchers.IsA(bool) # noqa[E712]
assert False == matchers.IsA(bool) # noqa: E712
assert {} == matchers.IsA(dict)
assert [] == matchers.IsA(list)
assert ("hello", "world") == matchers.IsA(tuple)
Expand All @@ -42,21 +42,21 @@ def test_is_a_matcher() -> None:


def test_is_a_matcher_checks_instance(decoy: Decoy) -> None:
"""The IsA matchers should respect ininstance logic."""
"""The IsA matchers should respect isinstance logic."""
target = decoy.mock(cls=SomeClass)
assert target == matchers.IsA(SomeClass)


def test_is_not_matcher() -> None:
"""It should have an "anything that isn't this" matcher."""
assert 1 == matchers.IsNot(2)
assert False == matchers.IsNot(True) # noqa[E712]
assert False == matchers.IsNot(True) # noqa: E712
assert {} == matchers.IsNot({"hello": "world"})
assert [] == matchers.IsNot(["hello", "world"])
assert ("hello", "world") == matchers.IsNot(("hey", "there"))

assert 1 != matchers.IsNot(1)
assert False != matchers.IsNot(False) # noqa[E712]
assert False != matchers.IsNot(False) # noqa: E712
assert {} != matchers.IsNot({})
assert [] != matchers.IsNot([])
assert ("hello", "world") != matchers.IsNot(("hello", "world"))
Expand All @@ -71,7 +71,7 @@ def test_has_attribute_matcher() -> None:
assert {"hello": "world"} != matchers.HasAttributes({"hello": "world"})
assert _HelloTuple("world") != matchers.HasAttributes({"goodbye": "so long"})
assert 1 != matchers.HasAttributes({"hello": "world"})
assert False != matchers.HasAttributes({"hello": "world"}) # noqa[E712]
assert False != matchers.HasAttributes({"hello": "world"}) # noqa: E712
assert [] != matchers.HasAttributes({"hello": "world"})


Expand All @@ -87,7 +87,7 @@ def test_dict_matching_matcher() -> None:

assert {"hello": "world"} != matchers.DictMatching({"goodbye": "so long"})
assert 1 != matchers.DictMatching({"hello": "world"})
assert False != matchers.DictMatching({"hello": "world"}) # noqa[E712]
assert False != matchers.DictMatching({"hello": "world"}) # noqa: E712
assert [] != matchers.DictMatching({"hello": "world"})


Expand All @@ -101,7 +101,7 @@ def test_error_matching_matcher() -> None:
"""It should have an "any error that matches" matcher."""
assert RuntimeError("ah!") == matchers.ErrorMatching(RuntimeError)
assert RuntimeError("ah!") == matchers.ErrorMatching(RuntimeError, "ah")
assert RuntimeError("ah!") != matchers.ErrorMatching(TypeError, "ah") # type: ignore[comparison-overlap] # noqa: E501
assert RuntimeError("ah!") != matchers.ErrorMatching(TypeError, "ah") # type: ignore[comparison-overlap]
assert RuntimeError("ah!") != matchers.ErrorMatching(RuntimeError, "ah$")


Expand Down
2 changes: 1 addition & 1 deletion tests/test_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class WarningSpec(NamedTuple):
"The same rehearsal was used in both a `when` and a `verify`.",
"This is redundant and probably a misuse of the mock.",
"\tspy(1)",
"See https://mike.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning", # noqa: E501
"See https://mike.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning",
]
),
),
Expand Down

0 comments on commit 1dc6abf

Please sign in to comment.