discover_environments() does not crash when the same environment/version is detected multiple times

While this should raise an exception.