requests 2.26 and its requirements break httpretty (see
gabrielfalcao/HTTPretty#409), so pin for the time being. Thanks to
Sébastien Besson and Dhruv Manilawala for the debugging assistance.
* Use pytest to parametrize tests
Use built-in pytest test case parametrization support over external
'parameterize' package. The latter is not well maintained, and has
known Python 3.8 failures unsolved since November 2019.
Since pytest fixtures are incompatible with unittest-style tests,
rewrite the relevant test case to use pytest-style asserts. This also
makes the resulting code simpler, as we no longer have to pass TestCase
to the helper classes.
* Refactor input cleaning in ReplayingConnection.__readNextRequest()
Due to the recent deprecation of setup.py test, we should move with the
times, and switch to a non-deprecated test runner.
Add configuration for pytest, and switch tox to using it. Remove
AllTests, since it is no longer required to locate test classes, and
rewrite tests/__main__.py as a pytest conftest plugin.
Also drop the test function from manage.sh, tox does a much better job.
* Handle unicode strings when recording responses (#1253)
* Add new test requirements
* Make requirement conditional
* Fix flake8 error
* Compare dict values without worrying about key order
* Improve readability
# Problem #
The `.whl` available on PyPi for this repository contains its entire `tests` submodule.
The total size of the `pygithub` module is less than `1mb` without tests and `>23mb` with.
Previous discussions on this topic indicated the removal of tests would be accepted if someone created a pull request to do so: https://github.com/PyGithub/PyGithub/issues/672
This is that pull request! 😄
# Solution/Implementation #
- Moved "tests" to root of the repository ( outside the package )
- Added `tests.` module path to the imports in `AllTests.py`
- Updated `setup.py`
- Removed `package_data` from product
- Removed "tests" from packages definition
- Repointed `test_suite` to new location
- Updated `travis.yml`
- Added conditional ( if not `py2.7` ) conversion of code to `py3`
_... apologies for all the failed build spam below - new to working with Travis CI / had some gotcha moments!_
This is a continuation of the work started by @allevin on https://github.com/PyGithub/PyGithub/pull/860.
I have refactored the testing Framework to use the `httpretty` library in order to use the urllib3 retry feature and therefore be able to test it.
Please refer to https://github.com/PyGithub/PyGithub/pull/860 for additional context.
cc: @allevin @mfonville @jrouquie @sfdye
Closes#757Closes#860
* works (but tests fail)
* Refactor to use python requests rather than httplib
* add requests dependency in setup.py
* touch so travis-ci will run
* clean up some unused comments
* Handle HTTP vs HTTPS; handle custom base_url
* Use requests session
* Don't use a persistent session in tests (which don't use the real requests library)
* Use an older version of requests for python 3.2
Requests dropped support for Python 3.2 in the 2.10 series (though it
didn't detect this until 2.11).
PyGithub probably doesn't need to support Python 3.2 at all; it's quite
old, with negligably few users, but that should be addressed elsewhere.
* Revert "Use an older version of requests for python 3.2"
This reverts commit fb0367614f5413968eeab98f4094e710aa1bc2d1.
* Improve readability
* Update requirements.txt
* Disable custom proxy handling code (unneeded and broken); use requests'
* Remove comment and superflous code
* Fix iteritems() removal from Python3
* pin requests to 2.14.0 or greater in prep for no_proxy
* pin requests to 2.14.0 or greater in prep for no_proxy