Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_session(self):
if HAS_REQUEST:
import requests
session = requests.Session()
session.headers.update({'X-FOO': 'bar'})
d = pq(self.application_url, {'q': 'foo'},
method='get', session=session)
self.assertIn('HTTP_X_FOO: bar', d('p').text())
else:
self.skipTest('no requests library')