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