pchomik / pytest-spec

Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION.
GNU General Public License v2.0
100 stars 19 forks source link

UserWarning: arguments declared in hookspec issued in pytest 4.2.0 #21

Closed bbengfort closed 4 years ago

bbengfort commented 5 years ago

It looks like pytest made some changes in their 4.2 release that affect pytest-spec. Namely, I'm receiving a bunch of the following warnings:

[snip]/site-packages/pytest_spec/patch.py:23: UserWarning: Argument(s) ('config',) which are declared in the hookspec can not be found in this hook call
    res = self.config.hook.pytest_report_teststatus(report=report)

I can ignore these errors, but it would be nice if we can sort them out. I'm happy to investigate and submit a PR if you'd like to point me the right direction.

lvieirajr commented 5 years ago

Bump, Facing the same problem.

hbarcelos commented 5 years ago

Same here. Any updates?

jhermann commented 5 years ago

This is all the fix you need. Question is whether someone is able make a release?

--- a/pytest_spec/patch.py
+++ b/pytest_spec/patch.py
@@ -20,7 +20,7 @@ def pytest_runtest_logreport(self, report):

     Hook changed to define SPECIFICATION like output format. This hook will overwrite also VERBOSE option.
     """
-    res = self.config.hook.pytest_report_teststatus(report=report)
+    res = self.config.hook.pytest_report_teststatus(report=report, config=self.config)
     cat, letter, word = res
     self.stats.setdefault(cat, []).append(report)
     if not letter and not word:
AnneTheAgile commented 4 years ago

yes agree how do we find out how to make a build ?

This was also fixed on fork: https://github.com/esnowkropla/pytest-spec/commit/a879fe79ae4032fd918302288795b9a70f810c40

it would be great to fix the warning officially.