We removed the test for this method in #4593, as the test was pointless (essentially, just comparing the method to a slight refactor of itself).
We should figure out a way to test the method properly. Perhaps, this would involve running the test inside a tox environment where all the packages are pinned.