[PATCH 51/51] tests: Add a way for the user to skip selenium tests

Damien Lespiau damien.lespiau at intel.com
Sat Sep 12 01:55:24 AEST 2015


It's a bit more convoluted to setup the test environment to work with
selenium (eg. needs a browser installed and Xorg running, ...). It's
possible someone would want to skip those.

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 patchwork/tests/browser.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/patchwork/tests/browser.py b/patchwork/tests/browser.py
index d13c770..da0cb9b 100644
--- a/patchwork/tests/browser.py
+++ b/patchwork/tests/browser.py
@@ -91,6 +91,10 @@ class SeleniumTestCase(StaticLiveServerTestCase):
     _SCREENSHOT_DIR = os.path.dirname(__file__) + '/../../test_screenshots'
 
     def setUp(self):
+        self.skip = os.getenv('PATCHWORK_SKIP_BROWSER_TESTS', None)
+        if self.skip:
+            self.skipTest("Disabled by environment variable")
+
         super(SeleniumTestCase, self).setUp()
 
         self.browser = os.getenv('SELENIUM_BROWSER', 'chrome')
-- 
2.1.0



More information about the Patchwork mailing list