Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: tests/rietveld_test.py

Issue 8508017: Standardize the sys.path fix up and fix a few pylint warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Previous patchset was broken Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/presubmit_unittest.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/rietveld_test.py
diff --git a/tests/rietveld_test.py b/tests/rietveld_test.py
index 798e84dd97a522f8316965523522629328ce8d61..84d5d636521b905a4ac2642932217eb65614f090 100755
--- a/tests/rietveld_test.py
+++ b/tests/rietveld_test.py
@@ -10,16 +10,12 @@ import os
import sys
import unittest
-ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.insert(0, os.path.join(ROOT_DIR, '..'))
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import patch
import rietveld
from tests.patches_data import GIT, RAW
-# Access to a protected member XX of a client class
-# pylint: disable=W0212
-
def _api(files):
"""Mock a rietveld api request."""
@@ -40,12 +36,16 @@ def _file(
class RietveldTest(unittest.TestCase):
def setUp(self):
+ super(RietveldTest, self).setUp()
+ # Access to a protected member XX of a client class
+ # pylint: disable=W0212
self.rietveld = rietveld.Rietveld('url', 'email', 'password')
self.rietveld._send = self._rietveld_send
self.requests = []
def tearDown(self):
self.assertEquals([], self.requests)
+ super(RietveldTest, self).tearDown()
def _rietveld_send(self, url, *args, **kwargs):
self.assertTrue(self.requests, url)
« no previous file with comments | « tests/presubmit_unittest.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698