diff mbox series

[09/12] oeqa/esdk/devtool: clean setUpClass/tearDownClass

Message ID 1488384162-18397-9-git-send-email-richard.purdie@linuxfoundation.org
State Accepted
Commit 6ecd671fb09486b5852c47f06b5db372a2eb082b
Headers show
Series [01/12] oeqa/sdkext/devtool: rename recipe name to match upstream | expand

Commit Message

Richard Purdie March 1, 2017, 4:02 p.m. UTC
From: Ross Burton <ross.burton@intel.com>


These methods are class not instance methods, so the argument should be cls not
self.

Also don't put variables into cls that we don't need there.

Signed-off-by: Ross Burton <ross.burton@intel.com>

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

---
 meta/lib/oeqa/sdkext/cases/devtool.py | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

-- 
2.7.4

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/lib/oeqa/sdkext/cases/devtool.py b/meta/lib/oeqa/sdkext/cases/devtool.py
index baa528f..ffaa2f0 100644
--- a/meta/lib/oeqa/sdkext/cases/devtool.py
+++ b/meta/lib/oeqa/sdkext/cases/devtool.py
@@ -11,14 +11,19 @@  from oeqa.core.decorator.data import skipIfNotDataVar
 
 class DevtoolTest(OESDKExtTestCase):
     @classmethod
-    def setUpClass(self):
-        self.myapp_src = os.path.join(self.tc.esdk_files_dir, "myapp")
-        self.myapp_dst = os.path.join(self.tc.sdk_dir, "myapp")
-        shutil.copytree(self.myapp_src, self.myapp_dst)
+    def setUpClass(cls):
+        myapp_src = os.path.join(cls.tc.esdk_files_dir, "myapp")
+        cls.myapp_dst = os.path.join(cls.tc.sdk_dir, "myapp")
+        shutil.copytree(myapp_src, cls.myapp_dst)
 
-        self.myapp_cmake_src = os.path.join(self.tc.esdk_files_dir, "myapp_cmake")
-        self.myapp_cmake_dst = os.path.join(self.tc.sdk_dir, "myapp_cmake")
-        shutil.copytree(self.myapp_cmake_src, self.myapp_cmake_dst)
+        myapp_cmake_src = os.path.join(cls.tc.esdk_files_dir, "myapp_cmake")
+        cls.myapp_cmake_dst = os.path.join(cls.tc.sdk_dir, "myapp_cmake")
+        shutil.copytree(myapp_cmake_src, cls.myapp_cmake_dst)
+
+    @classmethod
+    def tearDownClass(cls):
+        shutil.rmtree(cls.myapp_dst)
+        shutil.rmtree(cls.myapp_cmake_dst)
 
     def _test_devtool_build(self, directory):
         self._run('devtool add myapp %s' % directory)
@@ -111,8 +116,3 @@  class DevtoolTest(OESDKExtTestCase):
             self._run('devtool reset %s' % package_nodejs)
             raise e
         self._run('devtool reset %s '% package_nodejs)
-
-    @classmethod
-    def tearDownClass(self):
-        shutil.rmtree(self.myapp_dst)
-        shutil.rmtree(self.myapp_cmake_dst)