Skip to content
Myr

Fix up Appveyor testing

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Cory Benfield · committed by Cory Benfield · parent 8db8a7d · Browse files · 5 files+27 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+27 added−11 removed

  • other:+27 added−11 removed

5 files+27 added−11 removed

modified:requests/sessions.py+15 added-3 removed
6 unmodified lines
7This module provides a Session object to manage and persist settings across8requests (cookies, auth, proxies).9"""10import os11import platform12import time13from collections import Mapping12from datetime import datetime14from datetime import timedelta1516from .auth import _basic_auth_str17from .compat import cookielib, is_py3, OrderedDict, urljoin, urlparse18from .cookies import (
20 unmodified lines
39from .models import REDIRECT_STATI4041REDIRECT_CACHE_SIZE = 10004243# Preferred clock, based on which one is more accurate on a given system.44if platform.system() == 'Windows':45 try: # Python 3.3+46 preferred_clock = time.perf_counter47 except AttributeError: # Earlier than Python 3.48 preferred_clock = time.clock49else:50 preferred_clock = time.time515253def merge_setting(request_setting, session_setting, dict_class=OrderedDict):54 """Determines appropriate setting for a given request, taking into account55 the explicit setting on that request, and the setting in the session. If a56 setting is a dictionary, they will be merged together using `dict_class`
575 unmodified lines
632 # Get the appropriate adapter to use633 adapter = self.get_adapter(url=request.url)634635 # Start time (approximately) of the request625 start = datetime.utcnow()636 start = preferred_clock()637638 # Send the request639 r = adapter.send(request, **kwargs)640641 # Total elapsed time of the request (approximately)631 r.elapsed = datetime.utcnow() - start642 elapsed = preferred_clock() - start643 r.elapsed = timedelta(seconds=elapsed)644645 # Response manipulation hooks646 r = dispatch_hook('response', hooks, r, **kwargs)647
110 unmodified lines
modified:appveyor.yml+8 added-8 removed
modified:HISTORY.rst+2 added
9 unmodified lines
10 ``resolve_redirects`` will now detect a redirect by calling11 ``get_redirect_target(response)`` instead of directly12 querying ``Response.is_redirect`` and ``Response.headers['location']``.13 Advanced users will be able to process malformed redirects more easily.14- Changed the internal calculation of elapsed request time to have higher15 resolution on Windows.16172.13.0 (2017-01-24)18+++++++++++++++++++19
1300 unmodified lines
modified:Makefile+1 added
2 unmodified lines
3init:4 pip install pipenv5 pipenv lock6 pipenv install --dev7 pipenv run pip install -e .[socks]89test:10 # This runs all of the tests. To run an individual test, run py.test with11 # the -k flag, like "py.test -k test_path_is_not_double_encoded"
47 unmodified lines
modified:setup.py+1 added
95 unmodified lines
96 tests_require=test_requirements,97 extras_require={98 'security': ['pyOpenSSL>=0.14', 'cryptography>=1.3.4', 'idna>=2.0.0'],99 'socks': ['PySocks>=1.5.6, !=1.5.7'],100 'socks:platform_system == "Windows" and python_version<"3.3"': ['win_inet_pton'],101 },102)103