@patch("packge.class.method")
def setup(self, mock_method):
The mentioned method is with decorated @staticmethod
Error
@wraps(func)
def patched(*args, **keywargs):
with self.decoration_helper(patched,
args,
keywargs) as (newargs, newkeywargs):
> return func(*newargs, **newkeywargs)
E TypeError: setup() takes 2 positional arguments but 3 were given
.eggs/mock-4.0.3-py3.6.egg/mock/mock.py:1346: TypeError
When I use pytest 6.2.5 I do not see this error. This error happens when using pytest 7.+
Package Version
coverage 5.6b1
pytest 7.0.0rc1
pytest-cov 2.11.1
PyHamcrest 2.0.2
mock 4.0.3
tomli 1.2.3
OS: Linux 14.04.6 LTS, Trusty Tahr
Python: Python 3.6.8
Note: Truncated details due to limitations on what I can share about the code and packages.
I can answer further questions if this information is unsufficient.
Quick check-list while reporting bugs:
The mentioned method is with decorated @staticmethod
Error
When I use pytest 6.2.5 I do not see this error. This error happens when using pytest 7.+
Package Version
coverage 5.6b1
pytest 7.0.0rc1
pytest-cov 2.11.1
PyHamcrest 2.0.2
mock 4.0.3
tomli 1.2.3
OS: Linux 14.04.6 LTS, Trusty Tahr
Python: Python 3.6.8
Note: Truncated details due to limitations on what I can share about the code and packages.
I can answer further questions if this information is unsufficient.
Quick check-list while reporting bugs:
pip listfrom the virtual environment you are using