Fix regressions in running Mercurial unit tests.
Review Request #10994 — Created April 9, 2020 and submitted
The recent Mercurial SkipTest change broke running the Mercurial
Subversion tests, and any test suite that followed them. There were a
setUpClass()for the Mercurial Subversion tests changed the
current directory to a temp directory, which was then removed in
tearDownClass(), leaving the current working directory set to
a location that didn't exist (and breaking future
The code shuffle resulted in a
setUp()attempting to reference a
variable that no longer existed.
.hgrcloading no longer worked, as
temporary directory for it, set the path in the environment for all
future calls, and then that directory was deleted after the first
This change fixes each of these issues.
RBTestBaseclass now performs the same current directory
does for individual test runs, ensuring we never end up in this
situation between test suite runs.
.hgrccreation and environment population in
setUpClass()has been removed, instead passing the necessary arguments
directly on the command line to activate the extension, preventing any
test pollution. The old code for working with the class-level
map has also been removed, since it's dangerous and not used for
The code to set up a
$HOME/.hgrcfor each test run was restored, which
also fixed the bad environment variable reference.
This fixes the full test suite, with and without hgsubversion installed,
on all versions of Python.
All RBTools unit tests pass (with and without Mercurial and hgsubversion)
on all supported versions of Python.
Tested with Mercurial 4.4.x and 5.0.x (though this version isn't
yet compatible with hgsubversion, and will still break even though
hg svnreturns a suitable result).