Skip to content
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

Update dependency mock to v5 #2367

Merged
merged 2 commits into from
Aug 22, 2024
Merged

Update dependency mock to v5 #2367

merged 2 commits into from
Aug 22, 2024

Conversation

elastic-renovate-prod[bot]
Copy link
Contributor

This PR contains the following updates:

Package Update Change
mock (source) major ==4.0.3 -> ==5.1.0

Release Notes

testing-cabal/mock (mock)

v5.1.0

Compare Source

  • bpo-44185: :func:unittest.mock.mock_open will call the :func:close
    method of the file handle mock when it is exiting from the context
    manager. Patch by Samet Yaslan.

  • gh-94924: :func:unittest.mock.create_autospec now properly returns
    coroutine functions compatible with :func:inspect.iscoroutinefunction

  • bpo-17013: Add ThreadingMock to :mod:unittest.mock that can be used
    to create Mock objects that can wait until they are called. Patch by
    Karthikeyan Singaravelan and Mario Corchero.

  • bpo-41768: :mod:unittest.mock speccing no longer calls class properties.
    Patch by Melanie Witt.

v5.0.2

Compare Source

  • gh-102978: Fixes :func:unittest.mock.patch not enforcing function
    signatures for methods decorated with @classmethod or
    @staticmethod when patch is called with autospec=True.

  • gh-103329: Regression tests for the behaviour of
    unittest.mock.PropertyMock were added.

v5.0.1

Compare Source

  • 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.

v5.0.0

Compare Source

  • 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
    pass certain tests (e.g. isinstance) and builtin assert functions (e.g.
    assert_called_once_with) will unconditionally pass.

  • bpo-45010: Remove support of special method __div__ in
    :mod:unittest.mock. It is not used in Python 3.

  • gh-84753: :func:inspect.iscoroutinefunction now properly returns
    True when an instance of :class:unittest.mock.AsyncMock is passed to
    it. This makes it consistent with behavior of
    :func:asyncio.iscoroutinefunction. Patch by Mehdi ABAAKOUK.

  • bpo-46852: Remove the undocumented private float.__set_format__()
    method, previously known as float.__setformat__() in Python 3.7. Its
    docstring said: "You probably don't want to use this function. It exists
    mainly to be used in Python's test suite." Patch by Victor Stinner.

  • gh-98086: Make sure patch.dict() can be applied on async functions.

  • gh-100287: Fix the interaction of :func:unittest.mock.seal with
    :class:unittest.mock.AsyncMock.

  • gh-83076: Instantiation of Mock() and AsyncMock() is now 3.8x
    faster.

  • bpo-41877: A check is added against misspellings of autospect, auto_spec
    and set_spec being passed as arguments to patch, patch.object and
    create_autospec.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@elastic-renovate-prod elastic-renovate-prod bot requested a review from a team as a code owner August 19, 2024 16:38
@elastic-renovate-prod
Copy link
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@mjwolf mjwolf merged commit 71a5e5d into main Aug 22, 2024
4 checks passed
@mjwolf mjwolf deleted the renovate/mock-5.x branch August 22, 2024 00:07
lksnyder0 added a commit to huntresslabs/ecs that referenced this pull request Oct 9, 2024
* Add .caseless subfield to process.name & process.executable (elastic#2341)

Adds a subfield to the process.name and process.executable fields to improve the compatibility of data sources like System, Sysmon, etc., with our Elastic Defend data, which enables us to handle language limitations in KQL more effectively.

* Revert "Add .caseless subfield to process.name & process.executable" (elastic#2350)

This reverts commit 7815b3f from elastic#2341.

This is being reverted due to storage concerns. The goal will be to advance the native querying capabilities (ES|QL, KQL) of the Elastic stack such that this extra normalized multi-field is not necessary. In the meantime, localized overrides of the ECS field definition will be used to add the additional multi-field where needed. The downside of localized overrides are that it creates inconsistency across usages of the this field.

* [RFC] Apple Platform specific fields (elastic#2338)

Adds RFS stage 0

---------

Co-authored-by: Alexandra Konrad <[email protected]>
Co-authored-by: Michael Wolf <[email protected]>

* Add renovate.json (elastic#2352)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update template fields (elastic#2354)

Update some templated fields that were missed before merging the RFC

* Pin dependencies (elastic#2355)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update dependency PyYAML to v6.0.2 (elastic#2356)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update dependency gitpython to v3.1.43 (elastic#2358)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update dependency yamllint to v1.35.1 (elastic#2361)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update stale PR message (elastic#2369)

Add a friendlier stale PR message, based from the
[Beats stale message](https://github.com/elastic/beats/blob/main/.github/stale.yml#L63-L74).

This will hopefully also prompt contributors to respond, so we'll be better able to track PRs
people are still interested in contributing.

* Update actions/checkout action to v4 (elastic#2362)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update actions/github-script action to v7 (elastic#2363)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update actions/setup-python action to v5 (elastic#2364)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update actions/stale action to v9 (elastic#2365)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update dependency mock to v5 (elastic#2367)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update dependency ubuntu to v22 (elastic#2368)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update dependency autopep8 to v1.7.0 (elastic#2359)

Update dependency autopep8 to v1.7.0

---------

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* Update dependency autopep8 to v2 (elastic#2366)

* Update dependency autopep8 to v2

---------

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* add license header (elastic#2377)

* Update actions/setup-python digest to f677139 (elastic#2374)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Michael Wolf <[email protected]>

* [RFC] Stage 0: Introducing new field in rule namespace (elastic#2330)

* Update 0000-rfc-template.md

Updating the temaplate for RFC Stage 0 for adding 2 new rule fields: rule.tags and rule.remediation

* Update 0000-rfc-template.md

Incorporating review comments.

* Renaming the template file with recommended name

* Resolving conflicts

* Removing Tag Field

* Resolving comments from @trisch-me

* Moving file to rfcs/text folder as per @trisch-me comment. using next number in series.

* I saw number 44 was used in a recent RFC, using next number in series

---------

Co-authored-by: Eric Beahan <[email protected]>
Co-authored-by: Alexandra Konrad <[email protected]>

* [RFC] Stage 2: Adding Apple Platform specific fields (elastic#2370)

Updating the RFC and moving it to stage two.

* code blocks specified language yaml (elastic#2380)

Co-authored-by: Michael Wolf <[email protected]>

* trim trailing whitespace in schema (elastic#2379)

Co-authored-by: Michael Wolf <[email protected]>

* [RFC] Stage 0: Introducing new fields in ECS vulnerability field set (elastic#2331)

* RFC to add new fields in ECS vulnerability field set

RFC to add new fields in ECS vulnerability field set

* Moving to separate file

* set title and add stage 0 PR #

* clean up fields table markdown

* Moving to (rfcs/text) and renaming file to next number in series.

* Resolving the comments from @trisch-me

* Update rfcs/text/0045-additional-vulnerability-fields.md

Co-authored-by: Alexandra Konrad <[email protected]>

* Update rfcs/text/0045-additional-vulnerability-fields.md

Co-authored-by: Alexandra Konrad <[email protected]>

* Making changed to the date format as per comments from @trisch-me

* Resolving @trisch-me comments

* Resolving latest comments

* Update rfcs/text/0045-additional-vulnerability-fields.md

Co-authored-by: Alexandra Konrad <[email protected]>

---------

Co-authored-by: Eric Beahan <[email protected]>
Co-authored-by: Alexandra Konrad <[email protected]>

* Fix type in code signature (elastic#2382)

Change the type of code_signature.flags to keyword, which is what it should be. Also add a unit test that will verify all types are valid.

* Enforce yamllint in CI (elastic#2381)

Start running and enforcing yamllint checks in CI.

* Add Stage0 RFC for new fields for fileless execution on Linux (elastic#2322)

* Add support for settings

* Fix settings merging

* Restrict test workflow

* Fix merge conflicts

* Less restrictive

* Add docker files and pipeline

* Make building more restrictive

* Simplify build workflow

* Update tagging strategy

* Removing unused variable

* Kick?

* Anchors aren't supported 😭

* Fix role name

* Test branch name

* Remove extra default update (#3)

* Remove extra default update

* Fix role name

* Add support for a top-level type (#4)

* Add support for a top-level type

* Actually, don't need to be all the complicated

* Type needs to be nested within the field name (#5)

* Add documention for parameters field (#6)

* Add undocumented field argument

* Remove the PR template

---------

Co-authored-by: Jonhnathan <[email protected]>
Co-authored-by: Andrew Kroh <[email protected]>
Co-authored-by: Thijs Xhaflaire <[email protected]>
Co-authored-by: Alexandra Konrad <[email protected]>
Co-authored-by: Michael Wolf <[email protected]>
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Stefan Bischof <[email protected]>
Co-authored-by: Smriti <[email protected]>
Co-authored-by: Eric Beahan <[email protected]>
Co-authored-by: Michal Stanek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant