Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unset the http_proxy environment variable before running tests. #1236

Closed

Conversation

panlinux
Copy link
Contributor

Unset the http_proxy environment variable before running tests.

Description

Two connection tests (test_constructor and test_connection_to_unusual_port)
assume that there is no external real proxy in the test environment. Turns
out LibcloudConnection() will honor a http_proxy shell variable if it's set,
so if the test suite is run in such an environment, these tests will fail:

self = <libcloud.test.test_connection.BaseConnectionClassTestCase testMethod=test_connection_to_unusual_port>

    def test_connection_to_unusual_port(self):
        conn = LibcloudConnection(host='localhost', port=8080)
>       self.assertEqual(conn.proxy_scheme, None)
E       AssertionError: 'http' != None

libcloud/test/test_connection.py:107: AssertionError

self = <libcloud.test.test_connection.BaseConnectionClassTestCase testMethod=test_constructor>

    def test_constructor(self):
        conn = LibcloudConnection(host='localhost', port=80)
>       self.assertEqual(conn.proxy_scheme, None)
E       AssertionError: 'http' != None

libcloud/test/test_connection.py:80: AssertionError

I also added a test for this behavior (the honoring of http_proxy) to the existing test_constructor test.

Status

  • done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation
  • Tests
  • ICLA (required for bigger changes)

Two connection tests (test_constructor and test_connection_to_unusual_port)
assume that there is no external real proxy in the test environment. Turns
out LibcloudConnection() will honor a http_proxy shell variable if it's set,
so if the test suite is run in such an environment, these tests will fail.
Copy link
Contributor

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @panlinux! Will merge when I have a chance.

@asfgit asfgit closed this in 1cbb200 Aug 28, 2018
@pquentin
Copy link
Contributor

Turns out I was able to do it now. Thanks @panlinux! Merged in trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants