def test_fails_if_classes_not_specified(self): with pytest.raises(plug.PlugError) as exc_info: plugin.try_register_plugin(javac) assert javac.JavacCloneHook.__name__ in str(exc_info.value)
def test_modules_unregistered_after_fail(self): with pytest.raises(plug.PlugError): plugin.try_register_plugin(pylint, javac.JavacCloneHook) assert not plug.manager.get_plugins()
def test_modules_and_classes_unregistered_after_success(self): plugin.try_register_plugin(javac, javac.JavacCloneHook) assert not plug.manager.get_plugins()
def test_does_not_unregister_unrelated_plugins(self): plug.manager.register(pylint) plugin.try_register_plugin(javac, javac.JavacCloneHook) assert pylint in plug.manager.get_plugins()
def test_modules_unregistered_after_success(self): plugin.try_register_plugin(pylint) assert not plug.manager.get_plugins()