Kaydet (Commit) 036a71bf authored tarafından Berker Peksag's avatar Berker Peksag

Use setUpClass and tearDownClass correctly in test_os.

According to the documentation, they must be decorated as classmethods.
üst e1f68057
...@@ -1080,7 +1080,8 @@ class MakedirTests(unittest.TestCase): ...@@ -1080,7 +1080,8 @@ class MakedirTests(unittest.TestCase):
@unittest.skipUnless(hasattr(os, 'chown'), "Test needs chown") @unittest.skipUnless(hasattr(os, 'chown'), "Test needs chown")
class ChownFileTests(unittest.TestCase): class ChownFileTests(unittest.TestCase):
def setUpClass(): @classmethod
def setUpClass(cls):
os.mkdir(support.TESTFN) os.mkdir(support.TESTFN)
def test_chown_uid_gid_arguments_must_be_index(self): def test_chown_uid_gid_arguments_must_be_index(self):
...@@ -1125,7 +1126,8 @@ class ChownFileTests(unittest.TestCase): ...@@ -1125,7 +1126,8 @@ class ChownFileTests(unittest.TestCase):
os.chown(support.TESTFN, uid_1, gid) os.chown(support.TESTFN, uid_1, gid)
os.chown(support.TESTFN, uid_2, gid) os.chown(support.TESTFN, uid_2, gid)
def tearDownClass(): @classmethod
def tearDownClass(cls):
os.rmdir(support.TESTFN) os.rmdir(support.TESTFN)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment