def test_class_registered(self): _TESTS = test_dict() decorator = register_test() # class registered decorator(BasicTestB) assert "BasicTestB" in _TESTS assert BasicTestB in _TESTS.values() # cannot register same class with pytest.raises(AssertionError): decorator(BasicTestB) # # cannot register other class type with pytest.raises(AssertionError): decorator(NotATest)
def test_class_registered(self): _TESTS = test_dict() decorator = register_test() # class registered decorator(BasicTestB) assert 'BasicTestB' in _TESTS assert BasicTestB in _TESTS.values() # cannot register same class with pytest.raises(AssertionError): decorator(BasicTestB) # # cannot register other class type with pytest.raises(AssertionError): decorator(NotATest)
def test_same_instance_returned(self): decorator = register_test() NewBasicTest = decorator(BasicTestA) assert BasicTestA is NewBasicTest