Make sure you get a generator that is sized to your sump pump's starting current needs. Electric motors need a ton of current when starting.
Generators take regular maintenance or they too will fail when you need them.
You'll need to store gas.
That stored gas goes bad after 3-6 months (thanks ethanol!). You can add stabilizers to it (Stabil is the brand I've used) but that only stretches the life and adds cost.
If you don't want to store gas, get a siphon for your vehicle.
You'll want to empty out the gas after every use.
You'll need to change the oil on the manufacturers schedule.
With irregular use, you are more likely to clog the fuel filter. I'd keep and extra on hand.
You should run it every month. Say 5 minutes no load, 10 minutes low load, 10 minutes high load, 5 minutes no load.
Keeping a generator happy is a lot more work that checking your battery. If it were me, I'd replace the battery and add a calendar reminder to check it every month.