Fix comparison bug with 'rc' versions in packaging.version (#11841).

I added some tests in 2105ab8553b7 and found no bug, but it turns out
that the doctest is not actually run.  While converting the doctest to
unittest style, I stumbled upon this bug again and this time applied the
code patch provided by Filip Gruszczyński.
3 files changed