Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8023867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:41:33+00:00 2026-06-04T22:41:33+00:00

pytest_runtest_makereport() gets two arguments, item and call. From item, I can find the funcarg

  • 0

pytest_runtest_makereport() gets two arguments, item and call. From item, I can find the funcarg I created for this test, and from call, I can find the exception info (if any):

def pytest_runtest_makereport (item, call):
    my_funcarg = item.funcargs['name']
    my_funcarg.excinfo = call.excinfo

Unfortunately, excinfo is populated for both failures and for skips. To distinguish, I need to look at the report argument to pytest_report_teststatus():

def pytest_report_teststatus (report):
    if report.when == 'call':
        if report.failed:
            failed = True
        elif report.skipped:
            skipped = True
        else:
            passed = True

That’s great info, but I can’t correlate it to the funcarg I created for the test. I have looked at the report argument (a TestReport report), and I can’t find any way to get back to the item passed to pytest_runtest_makereport(), or the funcarg I created.

Where can I get access to both?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:41:34+00:00Added an answer on June 4, 2026 at 10:41 pm

    There is a little undocumented somewhat unofficial method with which hook implementations can interact with other hook implementations, for example to post-process their result. In your concrete case you might do something like:

    @pytest.mark.tryfirst
    def pytest_runtest_makereport(item, call, __multicall__):
        rep = __multicall__.execute()
        # your code follows and you can use rep.passed etc.
        return rep
    

    Notes:

    • a hook call will usually call multiple hook implementations
    • the “tryfirst” marker instructs the hook call to have your implementation be invoked early
    • the multicall parameter represents the ongoing hook call and can
      be used to call the remaining hook implementations and then
      use their result for further processing
    • you need to return “rep” here because you shadow the “real” creation

    The multicall API is very seldomly really and i suspect there could be solutions for your use case that don’t require it.

    HTH, Holger

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to learn PyInstaller. I created two simple files, Test.py: import os and
I am using manage.py test along with a JSON fixture I created using using
This is a simple structure in my project: MyAPP--- note--- __init__.py views.py urls.py test.py
I utilize the standard python logging module. When I call python manage.py test I'd
I am importing a file to my server using this command: scp zumodo@shold:/test/test/test/server.py /test/test/test/test.py~/;
this error arises when i try to run the following test case which is
What I would like is for C-c C-c to run py.test and display the
If I run the following command: >python manage.py test Django looks at tests.py in
With pytest, one can mark tests using a decorator @pytest.mark.slow def some_slow_test(): pass Then,
That's one.py: test = {'1': [1, 2, 3, 4, 5, 6, 7, 8, 9,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.