Page MenuHomePhabricator

HttpServerProblemTestCase.test_502 is failing on travis
Closed, ResolvedPublic

Description

https://travis-ci.org/wikimedia/pywikibot-core/jobs/188038123#L3853:

=================================== FAILURES ===================================

______________________ HttpServerProblemTestCase.test_502 ______________________

self = <tests.tests_tests.HttpServerProblemTestCase testMethod=test_502>

    def test_502(self):

        """Test a HTTP 502 response using http://httpbin.org/status/502."""

>       self.fail('The test framework should skip this test.')

E       AssertionError: The test framework should skip this test.

It has appeared after 431e72083ac18a (T153560), but I'm not sure if it's the actual cause or not.

Event Timeline

nikitavbv subscribed.

I think that is because of changes in aspects.py, which were done in 431e72083ac18a. I will fix this.

During Travis tests pytest test runner and pytest_httpbin module are used. Newly added code in aspects.py detects that and removes httpbin.org from the list of sites, because we are going to use pytest_httpbin, so we don't need to check if httpbin.org is accessible. The good solution to this problem is to check if test class inherits HttpbinTestCase class and remove httpbin.org from sites only in that case.
I will upload patch to fix that problem soon.

Change 330281 had a related patch set uploaded (by Phantom42):
Fix HttpServerProblemTestCase.test_502 failing

https://gerrit.wikimedia.org/r/330281

Change 330281 merged by jenkins-bot:
Fix HttpServerProblemTestCase.test_502 failing

https://gerrit.wikimedia.org/r/330281