summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-01 23:38:02 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-01 23:38:02 -0500
commit0b799319a7360bbf2497c037188217334346ba39 (patch)
tree917d207b06533ace29109ab7c92aea3bf966ef01 /setuptools/tests
parentf8285cac4b95e6b43869e27093ef04552e665681 (diff)
downloadpython-setuptools-git-0b799319a7360bbf2497c037188217334346ba39.tar.gz
Convert select tests to pytest model.
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_easy_install.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 19e1674c..61eb868f 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -133,9 +133,9 @@ class TestPTHFileWriter(unittest.TestCase):
self.assertTrue(not pth.dirty)
-class TestUserInstallTest(unittest.TestCase):
+class TestUserInstallTest:
- def setUp(self):
+ def setup_method(self, method):
self.dir = tempfile.mkdtemp()
setup = os.path.join(self.dir, 'setup.py')
with open(setup, 'w') as f:
@@ -151,7 +151,7 @@ class TestUserInstallTest(unittest.TestCase):
site.USER_SITE = tempfile.mkdtemp()
easy_install_pkg.__file__ = site.USER_SITE
- def tearDown(self):
+ def teardown_method(self, method):
os.chdir(self.old_cwd)
shutil.rmtree(self.dir)
@@ -170,7 +170,7 @@ class TestUserInstallTest(unittest.TestCase):
cmd = easy_install(dist)
cmd.args = ['py']
cmd.ensure_finalized()
- self.assertTrue(cmd.user, 'user should be implied')
+ assert cmd.user, 'user should be implied'
def test_multiproc_atexit(self):
try:
@@ -191,7 +191,7 @@ class TestUserInstallTest(unittest.TestCase):
cmd = easy_install(dist)
cmd.args = ['py']
cmd.initialize_options()
- self.assertFalse(cmd.user, 'NOT user should be implied')
+ assert not cmd.user, 'NOT user should be implied'
def test_local_index(self):
# make sure the local index is used
@@ -217,7 +217,7 @@ class TestUserInstallTest(unittest.TestCase):
res = cmd.easy_install('foo')
actual = os.path.normcase(os.path.realpath(res.location))
expected = os.path.normcase(os.path.realpath(new_location))
- self.assertEqual(actual, expected)
+ assert actual == expected
finally:
sys.path.remove(target)
for basedir in [new_location, target, ]: