[Python-checkins] cpython (3.5): Use setUpClass and tearDownClass correctly in test_os.

berker.peksag python-checkins at python.org
Tue Jul 21 08:29:40 CEST 2015


https://hg.python.org/cpython/rev/65959b843666
changeset:   96974:65959b843666
branch:      3.5
parent:      96972:75316f11b35c
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Tue Jul 21 09:29:48 2015 +0300
summary:
  Use setUpClass and tearDownClass correctly in test_os.

According to the documentation, they must be decorated as classmethods.

files:
  Lib/test/test_os.py |  6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1080,7 +1080,8 @@
 @unittest.skipUnless(hasattr(os, 'chown'), "Test needs chown")
 class ChownFileTests(unittest.TestCase):
 
-    def setUpClass():
+    @classmethod
+    def setUpClass(cls):
         os.mkdir(support.TESTFN)
 
     def test_chown_uid_gid_arguments_must_be_index(self):
@@ -1125,7 +1126,8 @@
             os.chown(support.TESTFN, uid_1, gid)
             os.chown(support.TESTFN, uid_2, gid)
 
-    def tearDownClass():
+    @classmethod
+    def tearDownClass(cls):
         os.rmdir(support.TESTFN)
 
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list