def test_singleton_error(): with pytest.raises(TypeError): class Fail(with_metaclass(SingletonParticleMeta, object)): pass