Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 7, 2023

Bumps mock from 4.0.2 to 5.0.1.

Changelog

Sourced from mock's changelog.

5.0.1

  • gh-100740: Fix unittest.mock.Mock not respecting the spec for attribute names prefixed with assert.

  • gh-100690: Mock objects which are not unsafe will now raise an AttributeError when accessing an attribute that matches the name of an assertion but without the prefix assert_, e.g. accessing called_once instead of assert_called_once. This is in addition to this already happening for accessing attributes with prefixes assert, assret, asert, aseert, and assrt.

  • gh-96127: inspect.signature was raising TypeError on call with mock objects. Now it correctly returns (*args, **kwargs) as infered signature.

5.0.0

  • gh-98624: Add a mutex to unittest.mock.NonCallableMock to protect concurrent access to mock attributes.

  • bpo-43478: Mocks can no longer be used as the specs for other Mocks. As a result, an already-mocked object cannot have an attribute mocked using autospec=True or be the subject of a create_autospec(...) call. This can uncover bugs in tests since these Mock-derived Mocks will always pass certain tests (e.g. isinstance) and builtin assert functions (e.g. assert_called_once_with) will unconditionally pass.

  • bpo-45156: Fixes infinite loop on :func:unittest.mock.seal of mocks created by :func:~unittest.create_autospec.

  • bpo-41403: Make :meth:mock.patch raise a :exc:TypeError with a relevant error message on invalid arg. Previously it allowed a cryptic :exc:AttributeError to escape.

  • gh-91803: Fix an error when using a method of objects mocked with :func:unittest.mock.create_autospec after it was sealed with :func:unittest.mock.seal function.

  • bpo-41877: AttributeError for suspected misspellings of assertions on mocks are now pointing out that the cause are misspelled assertions and also what to do if the misspelling is actually an intended attribute name. The unittest.mock document is also updated to reflect the current set of recognised misspellings.

  • bpo-43478: Mocks can no longer be provided as the specs for other Mocks. As a result, an already-mocked object cannot be passed to mock.Mock(). This can uncover bugs in tests since these Mock-derived Mocks will always

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot requested a review from a team as a code owner February 7, 2023 21:50
@dependabot dependabot bot requested review from jfuss and qingchm February 7, 2023 21:50
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Feb 7, 2023
@github-actions github-actions bot added pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Feb 7, 2023
@dependabot dependabot bot force-pushed the dependabot/pip/requirements/develop/mock-5.0.1 branch 2 times, most recently from b4d5dbb to d06f703 Compare February 9, 2023 23:45
@jfuss
Copy link
Contributor

jfuss commented Feb 10, 2023

Mock dependency shouldn't be needed anymore as it is in STDlib as of py3.3.

@dependabot dependabot bot force-pushed the dependabot/pip/requirements/develop/mock-5.0.1 branch from d06f703 to 92ddfb9 Compare February 13, 2023 17:53
Bumps [mock](https://github.com/testing-cabal/mock) from 4.0.2 to 5.0.1.
- [Release notes](https://github.com/testing-cabal/mock/releases)
- [Changelog](https://github.com/testing-cabal/mock/blob/master/CHANGELOG.rst)
- [Commits](testing-cabal/mock@4.0.2...5.0.1)

---
updated-dependencies:
- dependency-name: mock
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/pip/requirements/develop/mock-5.0.1 branch from 92ddfb9 to 69e9e0c Compare February 13, 2023 19:39
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Feb 13, 2023

Looks like mock is no longer a dependency, so this is no longer needed.

@dependabot dependabot bot closed this Feb 13, 2023
@dependabot dependabot bot deleted the dependabot/pip/requirements/develop/mock-5.0.1 branch February 13, 2023 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file pr/external python Pull requests that update Python code stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant