We develop extensions for Chrome, Firefox and Safari and we test our Chrome and Firefox extensions with Selenium. I recently added the timeout_decorator
to stop the tests if they run more than 15 minutes (you can see the answers to my former question), and it works on Linux (Ubuntu). But the problem is, it doesn't work on Windows. Here is my code:
import timeout_decorator
....
class BaseSeleniumTestCase(unittest.TestCase):
....
@timeout_decorator.timeout(seconds=900)
def _test_gmail_1_with_extension(self):
....
The test class inherits from BaseSeleniumTestCase
and runs the test. I can comment the decorators every time before I run the test in Windows, but I would like to have a better solution, without creating different tests. But it is possible to call another function which will check if we are in Windows or Linux, if we are in Windows it will run the test without the decorator and in Linux it will apply the decorator and run the test. Any suggestions?