Introduces new helper methods `is_defined`, `is_undefined`, `is_optional`, `is_optional_list` that is going to simplify input assertions in all our methods.
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
Comparing timestamps returned by the API with naive datetime objects (without timezone information) will raise an error. Add `tzinfo=datetime.timezone.utc` to your datetime instance.
Co-authored-by: John T. Wodder II <git@varonathe.org>
* Add crypto extras to pyjwt, which pulls in cryptogaphy package
* Remove cryptography dependency from more places
* Remove integrations extra from docs
* Pin pyjwt version
Pyjwt version is not fixed, which can cause syntax error for user since the release of breaking changes from pyjwt (https://pypi.org/project/PyJWT/#history)
* Update setup.py
Fixes#1796
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