summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 9e60f00..62edd6c 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -20,7 +20,7 @@ class FileTests(unittest.TestCase):
def test_access(self):
f = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR)
os.close(f)
- self.assert_(os.access(support.TESTFN, os.W_OK))
+ self.assertTrue(os.access(support.TESTFN, os.W_OK))
def test_closerange(self):
first = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR)
@@ -85,7 +85,7 @@ class TemporaryFileTests(unittest.TestCase):
def check_tempfile(self, name):
# make sure it doesn't already exist:
- self.failIf(os.path.exists(name),
+ self.assertFalse(os.path.exists(name),
"file already exists for temporary file")
# make sure we can create the file
open(name, "w")
@@ -102,7 +102,7 @@ class TemporaryFileTests(unittest.TestCase):
self.check_tempfile(name)
name = os.tempnam(support.TESTFN, "pfx")
- self.assert_(os.path.basename(name)[:3] == "pfx")
+ self.assertTrue(os.path.basename(name)[:3] == "pfx")
self.check_tempfile(name)
def test_tmpfile(self):
@@ -151,7 +151,7 @@ class TemporaryFileTests(unittest.TestCase):
fp.seek(0,0)
s = fp.read()
fp.close()
- self.assert_(s == "foobar")
+ self.assertTrue(s == "foobar")
def test_tmpnam(self):
import sys
@@ -176,7 +176,7 @@ class TemporaryFileTests(unittest.TestCase):
# the root of the current drive. That's a terrible place to
# put temp files, and, depending on privileges, the user
# may not even be able to open a file in the root directory.
- self.failIf(os.path.exists(name),
+ self.assertFalse(os.path.exists(name),
"file already exists for temporary file")
else:
self.check_tempfile(name)
@@ -228,7 +228,7 @@ class StatAttributeTests(unittest.TestCase):
def trunc(x): return x
self.assertEquals(trunc(getattr(result, attr)),
result[getattr(stat, name)])
- self.assert_(attr in members)
+ self.assertTrue(attr in members)
try:
result[200]
@@ -520,7 +520,7 @@ class MakedirTests(unittest.TestCase):
os.makedirs(path)
# Try paths with a '.' in them
- self.failUnlessRaises(OSError, os.makedirs, os.curdir)
+ self.assertRaises(OSError, os.makedirs, os.curdir)
path = os.path.join(base, 'dir1', 'dir2', 'dir3', 'dir4', 'dir5', os.curdir)
os.makedirs(path)
path = os.path.join(base, 'dir1', os.curdir, 'dir2', 'dir3', 'dir4',