code: def test_deprecated_factory_subclasses_detection():
      """Verify that meta-class Factory finds all subclasses"""
      # TODO: Remove in v0.3.0
  
      class Base:
          pass
  
      class A(Base):
          pass
  
      class B(Base):
          pass
  
      class AA(A):
          pass
  
      class AB(A):
          pass
  
      class AAA(AA):
          pass
  
      class AA_AB(AA, AB):
          pass
  
      class MyFactory(Base, metaclass=Factory):
          pass
  
      assert type(MyFactory(of_type="A")) is A
      assert type(MyFactory(of_type="B")) is B
      assert type(MyFactory(of_type="AA")) is AA
      assert type(MyFactory(of_type="AAA")) is AAA
      assert type(MyFactory(of_type="AA_AB")) is AA_AB
  
      # Test if there is duplicates
      assert MyFactory.types == {
          cls.__name__.lower(): cls
          for cls in [A, B, AA, AB, AAA, AA_AB]
      }
  
      with pytest.raises(NotImplementedError) as exc_info:
          MyFactory(of_type="random")
      assert (
          "Could not find implementation of Base, type = 'random'"
          in str(exc_info.value)
      )
  
      class Random(Base):
          pass
  
      assert type(MyFactory(of_type="random")) is Random
  
imports: import pytest
  from orion.core.utils import Factory, GenericFactory, float_to_digits_list
label_desc: Use image node_id 1 for calling a global function with example usage: test_deprecated_factory_subclasses_detection() without return types