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

Damien Lespiau damien.lespiau at intel.com
Wed Sep 23 02:11:48 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 9a6c4de..5047928 100644
--- a/patchwork/tests/browser.py
+++ b/patchwork/tests/browser.py
@@ -94,6 +94,10 @@ class SeleniumTestCase(StaticLiveServerTestCase):
     _SCREENSHOT_DIR = os.path.dirname(__file__) + '/../../selenium_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