Skip to content Skip to sidebar Skip to footer

Nosetest And Unittest.expectedfailures

I am currently testing my website with Selenium, Python and nosetests. Everything works fine for success tests, I got a problem on failure tests (I have never test with Python / Se

Solution 1:

The decorator with nose to handle an expected exception is @raises(...):

http://nose.readthedocs.io/en/latest/testing_tools.html

But in your case, you could simply use assertNotEqual without the decorator:

deftest_connection_failure(self):

    # Fill the username with the login onlyself.driver.find_element_by_id('form_identifiant').send_keys(test_login)

    # Send the formself.driver.find_element_by_id('form_submit').click()

    # Check the landing URL
    page_url = self.driver.current_url
    self.assertNotEqual(page_url, page_home)

Post a Comment for "Nosetest And Unittest.expectedfailures"