[Python-checkins] cpython (merge 3.5 -> default): 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/0308327eb250
changeset: 96975:0308327eb250
parent: 96973:366ee0f84118
parent: 96974:65959b843666
user: Berker Peksag <berker.peksag at gmail.com>
date: Tue Jul 21 09:30:09 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
@@ -1079,7 +1079,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):
@@ -1124,7 +1125,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