def METHOD_NAME(self) -> None:
    """Complain if a package required for an extra is missing or old."""
    with patch(
        "synapse.util.check_dependencies.metadata.requires",
        return_value=["dummypkg >= 1; extra == 'cool-extra'"],
    ), patch("synapse.util.check_dependencies.RUNTIME_EXTRAS", {"cool-extra"}):
        with self.mock_installed_package(None):
            self.assertRaises(DependencyException, check_requirements, "cool-extra")
        with self.mock_installed_package(old):
            self.assertRaises(DependencyException, check_requirements, "cool-extra")
        with self.mock_installed_package(new):
            # should not raise
            check_requirements("cool-extra")