diff options
| author | Guillaume Gauvrit <guillaume@gandi.net> | 2013-07-29 14:51:59 +0200 |
|---|---|---|
| committer | Guillaume Gauvrit <guillaume@gandi.net> | 2013-07-29 14:51:59 +0200 |
| commit | 4d77c5dd9e9b13121ae5ea433c4e49ed3be152af (patch) | |
| tree | f5a092899a19844ac1a6c5a8ffde7d4abfbe1d59 /tests/functional/test_bypass.py | |
| parent | 9d03c1cf5b08cb13bbf4db69115895d1316aa632 (diff) | |
| download | httpretty-4d77c5dd9e9b13121ae5ea433c4e49ed3be152af.tar.gz | |
Don't duplicate http ports number
Use a set instead of a list to store ports in the POTENTIAL_HTTP_PORTS.
Restore it to its initial value every tests that modify it.
Diffstat (limited to 'tests/functional/test_bypass.py')
| -rw-r--r-- | tests/functional/test_bypass.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/functional/test_bypass.py b/tests/functional/test_bypass.py index 2973141..6409eb5 100644 --- a/tests/functional/test_bypass.py +++ b/tests/functional/test_bypass.py @@ -35,6 +35,7 @@ from .testserver import TornadoServer, TCPServer, TCPClient from sure import expect, that_with_context import httpretty +from httpretty import core def start_http_server(context): @@ -92,7 +93,7 @@ def test_httpretty_bypasses_when_disabled(context): fd.close() expect(got3).to.equal(b'glub glub') - + core.POTENTIAL_HTTP_PORTS.remove(9999) @httpretty.activate @that_with_context(start_http_server, stop_http_server) @@ -114,6 +115,7 @@ def test_httpretty_bypasses_a_unregistered_request(context): fd.close() expect(got2).to.equal(b'<- HELLO WORLD ->') + core.POTENTIAL_HTTP_PORTS.remove(9999) @httpretty.activate |
