Skip to content

Class dependencies are used only on first test #6068

@richtja

Description

@richtja

Describe the bug
If we declare dependencies for test class, avocado will fulfil the dependency only for the first test and others are skipped.

Steps to reproduce

from avocado import Test


class PassTest(Test):
    """
    Example test that passes.

    :avocado: dependency={"type": "package", "name": "hello"}
    """

    def test(self):
        """
        A test simply doesn't have to fail in order to pass
        """
    
    def testi_1(self):
        """
        A test simply doesn't have to fail in order to pass
        """

Expected behavior

$ avocado run examples/tests/passtest_with_dependency.py
JOB ID     : 5277ab385cf56d90fd7c527cb8da66a6e55681da
JOB LOG    : /home/janrichter/avocado/job-results/job-2024-11-20T11.09-5277ab3/job.log
 (2/2) examples/tests/passtest_with_dependency.py:PassTest.testi_1: STARTED
 (2/2) examples/tests/passtest_with_dependency.py:PassTest.testi_1: PASS
 (1/2) examples/tests/passtest_with_dependency.py:PassTest.test: STARTED
 (1/2) examples/tests/passtest_with_dependency.py:PassTest.test: PASS
RESULTS    : PASS 0 | ERROR 0 | FAIL 0 | SKIP 2 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /home/janrichter/avocado/job-results/job-2024-11-20T11.09-5277ab3/results.html
JOB TIME   : 3.82 s

Current behavior

$ avocado run examples/tests/passtest_with_dependency.py
JOB ID     : 5277ab385cf56d90fd7c527cb8da66a6e55681da
JOB LOG    : /home/janrichter/avocado/job-results/job-2024-11-20T11.09-5277ab3/job.log
 (2/2) examples/tests/passtest_with_dependency.py:PassTest.testi_1: STARTED
 (2/2) examples/tests/passtest_with_dependency.py:PassTest.testi_1: SKIP: Dependency was not fulfilled.
 (1/2) examples/tests/passtest_with_dependency.py:PassTest.test: STARTED
 (1/2) examples/tests/passtest_with_dependency.py:PassTest.test: PASS
RESULTS    : PASS 0 | ERROR 0 | FAIL 0 | SKIP 2 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /home/janrichter/avocado/job-results/job-2024-11-20T11.09-5277ab3/results.html
JOB TIME   : 3.82 s

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions