Skip to content

Comments

[FIX] mock.patch(auto_spec=True) does not exist#903

Merged
OCA-git-bot merged 1 commit intoOCA:15.0from
gurneyalex:15.0-queue_job_auto_test_typo
Feb 20, 2026
Merged

[FIX] mock.patch(auto_spec=True) does not exist#903
OCA-git-bot merged 1 commit intoOCA:15.0from
gurneyalex:15.0-queue_job_auto_test_typo

Conversation

@gurneyalex
Copy link
Member

There is no parameter auto_spec to mock.patch. This is likely a typo.

Running the tests with Python 3.12 give a RuntimeError

  File "/usr/local/lib/python3.12/unittest/mock.py", line 1311, in __init__
    _check_spec_arg_typos(kwargs)
  File "/usr/local/lib/python3.12/unittest/mock.py", line 1287, in _check_spec_arg_typos
    raise RuntimeError(
RuntimeError: 'auto_spec' might be a typo.

There is no parameter auto_spec to mock.patch. This is likely a typo.

Running the tests with Python 3.12 give a RuntimeError
```
  File "/usr/local/lib/python3.12/unittest/mock.py", line 1311, in __init__
    _check_spec_arg_typos(kwargs)
  File "/usr/local/lib/python3.12/unittest/mock.py", line 1287, in _check_spec_arg_typos
    raise RuntimeError(
RuntimeError: 'auto_spec' might be a typo.
```
@OCA-git-bot
Copy link
Contributor

Hi @guewen,
some modules you are maintaining are being modified, check this out!

@gurneyalex
Copy link
Member Author

backport of #898

@gurneyalex gurneyalex added this to the 15.0 milestone Feb 20, 2026
@gurneyalex
Copy link
Member Author

Did something change in the pre-commit config on the 15.0 branch?

@pedrobaeza
Copy link
Member

Yes, a new setuptools version has broken it. You have to do a copier update, and maybe select to use whool.

@guewen
Copy link
Member

guewen commented Feb 20, 2026

Hi @gurneyalex , @pedrobaeza, I ran a copier update here: #905

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 15.0-ocabot-merge-pr-903-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit b5b5ed7 into OCA:15.0 Feb 20, 2026
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at c67b011. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants