GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Item._obj is not guaranteed to exist · Issue #542 · allure-framework/allure-python

Item._obj is not guaranteed to exist #542

New issue
Copy link
New issue
Copy link
Closed
Closed
Item._obj is not guaranteed to exist#542
Copy link

Description

@dmtucker
dmtucker
opened on Jan 9, 2021
Issue body actions

allure-python/allure-pytest/src/utils.py

Line 34 in 524beb8

return getattr(item._obj, '__allure_display_name__', None)

This code has come up in a pytest-mypy issue because ._obj (which seems to be available publicly as .obj, btw) is not defined on MypyItems (custom pytest.Items used for running mypy on collected modules). Moreover, I don't know of a way to reasonably define it since MypyItems are not associated with any particular test function. That suggests that perhaps allure-pytest should be made to ignore such Items or, in this case, at least gracefully degrade into returning None when allure_title is called on them:

try:
    return item.obj.__allure_display_name__
except AttributeError:
    return None
Reacted by Tomer Nosrati and Vladimir Gorkavenko
Reacted by Tomer Nosrati

Activity

  1. vgorkavenko
    added a commit that references this issue on Jan 13, 2021

    Fix Issue allure-framework#542

    bdce11f
  2. sseliverstov
    closed this as completedin 163f08con Jan 13, 2021
  3. beckerGil
    added a commit that references this issue on Apr 10, 2023

    Fix getattr issue for display name feature (fixes allure-framework#542 …

    This issue will close once commit 7dbed65 is merged into the 'master' branch.
    7dbed65
  4. IvanBuruyane
    added 2 commits that reference this issue on Mar 19, 2024

    Fix getattr issue for display name feature (fixes allure-framework#542 …

    This issue will close once commit 4ec6506 is merged into the 'master' branch.
    4ec6506

    Fix getattr issue for display name feature (fixes allure-framework#542 …

    This issue will close once commit 163f08c is merged into the 'master' branch.
    163f08c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.