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

Incorrect arguments to ExceptionRepr #160

Closed
etse1288 opened this issue Mar 14, 2024 · 5 comments
Closed

Incorrect arguments to ExceptionRepr #160

etse1288 opened this issue Mar 14, 2024 · 5 comments

Comments

@etse1288
Copy link

see:

reprtraceback = ExceptionRepr(reprcrash, excinfo)

  • Shouldn't the 2nd argument be reprcrash (of type ReprFileLocation)?
  • Shouldn't the 1st argument be of type ReprTraceback and not the type of either reprcash or excinfo (ExceptionInfo)?
@okken
Copy link
Owner

okken commented Mar 14, 2024

PRs welcome. :)

Seriously, though. I think you're probably right.

However, I don't see any incorrect behavior.
Are you seeing any test results that are incorrect due to this line?

@Spencer-Drach-Bose
Copy link

Spencer-Drach-Bose commented Apr 18, 2024

I'm getting this error too, Here's the full trace:

INTERNALERROR>   File "C:\.venv\lib\site-packages\_pytest\main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "C:\.venv\lib\site-packages\_pytest\main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_callers.py", line 181, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_result.py", line 99, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "C:\.venv\lib\site-packages\_pytest\main.py", line 348, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_callers.py", line 181, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_result.py", line 99, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "C:\.venv\lib\site-packages\_pytest\runner.py", line 109, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "C:\.venv\lib\site-packages\_pytest\runner.py", line 126, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "C:\.venv\lib\site-packages\_pytest\runner.py", line 217, in call_and_report
INTERNALERROR>     report: TestReport = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pluggy\_callers.py", line 155, in _multicall
INTERNALERROR>     teardown[0].send(outcome)
INTERNALERROR>   File "C:\.venv\lib\site-packages\pytest_check\plugin.py", line 48, in pytest_runtest_makereport
INTERNALERROR>     reprtraceback = ExceptionRepr(reprcrash, excinfo)
INTERNALERROR> TypeError: ExceptionRepr.__init__() takes 1 positional argument but 3 were given

I'm running pytest version 6.2.5 and pytest-check version 2.2.3

@okken
Copy link
Owner

okken commented Apr 18, 2024

Please try pytest-check version 2.3.1 and a pytest version greater than 7.0.0.
pytest-check only supports pytest >= 7.0.0 and only the latest version of pytest-check

@okken
Copy link
Owner

okken commented Apr 18, 2024

@Spencer-Drach-Bose if you still see a problem, please post an example test that demonstrates the problem.

@Spencer-Drach-Bose
Copy link

That worked, Thank you!

@okken okken closed this as completed Apr 18, 2024
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

No branches or pull requests

3 participants