summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-07-21 06:29:48 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-07-21 06:29:48 (GMT)
commit036a71bf25b84fab72b023eaf9591e9c16ae2c52 (patch)
tree24e48157f7f883ed7f8282d6c4a0cdd3a89855e8
parente1f6805776b9b85791f9b3ae2cf998b7fed4a5bf (diff)
downloadcpython-036a71bf25b84fab72b023eaf9591e9c16ae2c52.zip
cpython-036a71bf25b84fab72b023eaf9591e9c16ae2c52.tar.gz
cpython-036a71bf25b84fab72b023eaf9591e9c16ae2c52.tar.bz2
Use setUpClass and tearDownClass correctly in test_os.
According to the documentation, they must be decorated as classmethods.
-rw-r--r--Lib/test/test_os.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 2e23615..d91f58c 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1080,7 +1080,8 @@ class MakedirTests(unittest.TestCase):
@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 @@ class ChownFileTests(unittest.TestCase):
os.chown(support.TESTFN, uid_1, gid)
os.chown(support.TESTFN, uid_2, gid)
- def tearDownClass():
+ @classmethod
+ def tearDownClass(cls):
os.rmdir(support.TESTFN)