FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(pytest): properly include nested classes in fullName, historyId, testCaseId, and subSuite by delatrie · Pull Request #869 · allure-framework/allure-python · GitHub

fix(pytest): properly include nested classes in fullName, historyId, testCaseId, and subSuite - #869

Merged
delatrie merged 3 commits into
masterfrom
issue-868-nested-classes
Jul 9, 2025
Merged

fix(pytest): properly include nested classes in fullName, historyId, testCaseId, and subSuite#869
delatrie merged 3 commits into
masterfrom
issue-868-nested-classes

Conversation

delatrie commented Jul 9, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

Context

Pytest supports nested test classes:

class TestFoo:
    class TestBar:
        def test_baz(self):
            pass

Currently, Allure Pytest incorrectly assumes there is zero or one test class in every given nodeid when calculating fullName and subSuite. Since the test above has nodeid module_test.py::TestFoo::TestBar::test_baz, the calculations become invalid.

Given that testCaseId and historyId depend on fullName, these properties are calculated incorrectly as well.

The PR fixes how Allure Pytest handles such cases:

  • All test classes are now included in fullName (joined with .).
  • All test classes are now included in the value of the subSuite label (joined with >).

Fixes #868.

Checklist

delatrie added theme:pytest type:bug Pull requests that fix bugs labels Jul 9, 2025
delatrie merged commit 0f7da56 into master Jul 9, 2025
delatrie deleted the issue-868-nested-classes branch July 9, 2025 15:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme:pytest type:bug Pull requests that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pytest: nested classes break fullName, testCaseId, historyId, and subSuite

2 participants


Back | FazBrowse Home | New Git URL