avocado-framework/avocado

Safeloader ignores unittest.TestCase classes when avocado.Test used in same file

clebergnu opened this issue · 0 comments

Describe the bug
If a Python file contains two test classes, when inheriting from unittest.TestCase and another from avocado.Test, the one using unittest.TestCase will be masked out.

Steps to reproduce

from unittest import TestCase
from avocado import Test


class UnittestTest(TestCase):
    def test(self):
        pass


class AvocadoTest(Test):
    def test(self):
        pass

Expected behavior

$ avocado list /tmp/t.py
python-unittest      /tmp/t.py:UnittestTest.test
avocado-instrumented /tmp/t.py:AvocadoTest.test

Current behavior

$ avocado list /tmp/t.py
avocado-instrumented /tmp/t.py:AvocadoTest.test

System information (please complete the following information):

  • OS: LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distributor ID: Fedora Description: Fedora release 38 (Thirty Eight) Release: 38 Codename: ThirtyEight
  • Avocado version: 0c02519
  • Avocado installation method: GIT