summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_dist.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-05-10 20:52:01 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-05-10 20:52:01 (GMT)
commit10f5db6424595f0389ff84e053a12a1b60d73cd2 (patch)
tree3d518843159383fd096c9478e72f124ea5ef2e3e /Lib/distutils/tests/test_dist.py
parent844f757aae9b2e4975d4b98f8dc8b5f5fbd69608 (diff)
downloadcpython-10f5db6424595f0389ff84e053a12a1b60d73cd2.zip
cpython-10f5db6424595f0389ff84e053a12a1b60d73cd2.tar.gz
cpython-10f5db6424595f0389ff84e053a12a1b60d73cd2.tar.bz2
Revert r62998 as it broke the build (seems distutils.config is missing).
Diffstat (limited to 'Lib/distutils/tests/test_dist.py')
-rw-r--r--Lib/distutils/tests/test_dist.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py
index 2857263..5ae7933 100644
--- a/Lib/distutils/tests/test_dist.py
+++ b/Lib/distutils/tests/test_dist.py
@@ -55,7 +55,6 @@ class DistributionTestCase(unittest.TestCase):
self.assertEqual(d.get_command_packages(), ["distutils.command"])
def test_command_packages_cmdline(self):
- from distutils.tests.test_dist import test_dist
sys.argv.extend(["--command-packages",
"foo.bar,distutils.tests",
"test_dist",
@@ -66,7 +65,6 @@ class DistributionTestCase(unittest.TestCase):
self.assertEqual(d.get_command_packages(),
["distutils.command", "foo.bar", "distutils.tests"])
cmd = d.get_command_obj("test_dist")
- print cmd.__class__, test_dist
self.assert_(isinstance(cmd, test_dist))
self.assertEqual(cmd.sample_option, "sometext")
@@ -181,54 +179,9 @@ class MetadataTestCase(unittest.TestCase):
dist.metadata.write_pkg_file(sio)
return sio.getvalue()
- def test_custom_pydistutils(self):
- # fixes #2166
- # make sure pydistutils.cfg is found
- old = {}
- for env in ('HOME', 'HOMEPATH', 'HOMEDRIVE'):
- value = os.environ.get(env)
- old[env] = value
- if value is not None:
- del os.environ[env]
-
- if os.name == 'posix':
- user_filename = ".pydistutils.cfg"
- else:
- user_filename = "pydistutils.cfg"
-
- curdir = os.path.dirname(__file__)
- user_filename = os.path.join(curdir, user_filename)
- f = open(user_filename, 'w')
- f.write('.')
- f.close()
-
- try:
- dist = distutils.dist.Distribution()
-
- # linux-style
- if sys.platform in ('linux', 'darwin'):
- os.environ['HOME'] = curdir
- files = dist.find_config_files()
- self.assert_(user_filename in files)
-
- # win32-style
- if sys.platform == 'win32':
- # home drive should be found
- os.environ['HOMEPATH'] = curdir
- files = dist.find_config_files()
- self.assert_(user_filename in files)
- finally:
- for key, value in old.items():
- if value is None:
- continue
- os.environ[key] = value
- os.remove(user_filename)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(DistributionTestCase))
suite.addTest(unittest.makeSuite(MetadataTestCase))
return suite
-
-if __name__ == "__main__":
- unittest.main(defaultTest="test_suite")