diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-06-24 08:48:27 +0300 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-06-24 08:48:27 +0300 |
commit | 91d53e7b20baf5b9b58cb9737b8871793c23fd7b (patch) | |
tree | be7552d0b7933ccb2ba774a3397c816c4baf0b00 /Lib/distutils/tests/test_config.py | |
parent | 9e941d6373ea5e233a26e5fb0af6731d88f14049 (diff) | |
download | cpython-git-91d53e7b20baf5b9b58cb9737b8871793c23fd7b.tar.gz |
Make PyPIRCCommandTestCase derive from a base class
Several test cases in distutils use PyPIRCCommandTestCase as
their base class and as a result of that the following tests
were ran more than once:
* test_server_registration
* test_server_empty_registration
* test_config_interpolation
This commit moves the infrastructure used by other tests
into a new BasePyPIRCCommandTestCase class.
Diffstat (limited to 'Lib/distutils/tests/test_config.py')
-rw-r--r-- | Lib/distutils/tests/test_config.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/distutils/tests/test_config.py b/Lib/distutils/tests/test_config.py index 0b91d19a54..3dd92d6166 100644 --- a/Lib/distutils/tests/test_config.py +++ b/Lib/distutils/tests/test_config.py @@ -52,14 +52,14 @@ password:xxx """ -class PyPIRCCommandTestCase(support.TempdirManager, +class BasePyPIRCCommandTestCase(support.TempdirManager, support.LoggingSilencer, support.EnvironGuard, unittest.TestCase): def setUp(self): """Patches the environment.""" - super(PyPIRCCommandTestCase, self).setUp() + super(BasePyPIRCCommandTestCase, self).setUp() self.tmp_dir = self.mkdtemp() os.environ['HOME'] = self.tmp_dir self.rc = os.path.join(self.tmp_dir, '.pypirc') @@ -78,7 +78,10 @@ class PyPIRCCommandTestCase(support.TempdirManager, def tearDown(self): """Removes the patch.""" set_threshold(self.old_threshold) - super(PyPIRCCommandTestCase, self).tearDown() + super(BasePyPIRCCommandTestCase, self).tearDown() + + +class PyPIRCCommandTestCase(BasePyPIRCCommandTestCase): def test_server_registration(self): # This test makes sure PyPIRCCommand knows how to: |