Skip to content

Inherited test cases cannot be run separately #14882

Description

@mdabrowski1990

Description

I cannot execute a inherited test. I am forced to execute all test cases in children class.
From my perspective, they are not correctly gathered.
Both parametrized and non-parametrize test cases are affected.

Example code

import pytest

class BaseTests:  
    """Base class defining typical tests."""

    def test_1(self):
        ...


class TestsForProduct(BaseTests):
    """Product class adapting parameters, fixtures and attributes for product specific behavior."""

Screenshoots

In real example TestHVIL class inherits test_hvil_open test case and adapts fixtures.

Whole class execution is fine:
Image

When I try to run only the inherited test case (test_hvil_open) it says that the test suite is empty:
Image
Image

Configuration

OS: Windows (it seems that the problem is not OS related)
pytest version: 9:1.1

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