summaryrefslogtreecommitdiff
path: root/tests/conftest.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix loading cached JSON content when decode_content=True and the root ↵Jordan Cook2023-05-081-0/+8
| | | | element is a list
* Enable bugbear extension and fix warningsJordan Cook2023-05-081-4/+4
|
* Use time-machine instead of sleep for timing-based testsJordan Cook2023-04-021-1/+10
|
* Share SQLite connection objects among threads and use lock for write ↵Jordan Cook2023-03-011-1/+1
| | | | operations instead of using thread-local connections
* Don't raise_for_status if status_code of response is in allowable_codesDavid Dv Schmidt2023-02-181-0/+4
|
* Add tests for pypy3.9Jordan Cook2022-12-301-0/+7
|
* Silence DeprecationWarnings during tests for deprecated methodsJordan Cook2022-09-301-0/+10
|
* Some additional logging and testsJordan Cook2022-06-161-0/+8
|
* Split up remove_expired_reponses() into remove() and reset_expiration() ↵Jordan Cook2022-06-111-1/+5
| | | | methods, with more granular arguments
* Implement Cache-Control: stale-while-revalidateJordan Cook2022-05-041-2/+3
|
* Skip tests for optional serializer dependencies if not installedJordan Cook2022-04-221-4/+20
|
* Add support for DynamoDB TTLJordan Cook2022-04-201-20/+11
|
* Add links to source files on Examples pageJordan Cook2022-04-181-4/+4
|
* Also skip cache read for requests excluded by allowable_methodsJordan Cook2022-04-091-5/+3
|
* Refactor refresh/revalidate behaviorJordan Cook2022-04-091-1/+7
| | | | | | | | | | | | | | | * Rename two (unreleased) options to be more consistent with browser behavior: * `revalidate()` -> `refresh()` * `refresh()` -> `force_refresh()` * Revert `RequestSettings` changes and use just kwargs instead for per-request settings * Add full type hints back to extra kwargs for `CachedSession.send()` * Fix a bug in which some kwargs specific to requests-cache could get passed to `requests.Session.send()` * Use 'must-revalidate' as a temporary header for a user-requested refresh * Refer to expiration value of 0 more accurately as 'expire immediately' rather than 'do not cache' * It may potentially be saved and used with revalidation, depending on other headers/settings * `DO_NOT_CACHE` now has a different value but same effect * Refer to constants in docs instead of 0, -1, etc. * Log more details about post-read and pre-cache checks
* Fix some regression bugs and broken testsJordan Cook2022-03-291-0/+16
|
* Add more unit test coverage for new revalidation behaviorJordan Cook2022-03-111-0/+7
|
* Improve multithreaded tests: use fewer unique responses and more total ↵Jordan Cook2022-02-221-1/+2
| | | | requests to increase concurrent cache hits
* Define __all__ for a couple more modules for star importsJordan Cook2021-09-201-4/+3
|
* Use pytest tmpdir fixture + UUID instead of NamedTemporaryFileJordan Cook2021-08-191-29/+19
|
* Increase integration test timeout for DynamoDB, since it has a longer ↵Jordan Cook2021-08-141-9/+12
| | | | startup time
* Add unit tests for new header supportJordan Cook2021-08-141-1/+4
|
* Add more test coverage for cache_control and cache_keys modulesJordan Cook2021-08-121-2/+2
|
* Apply whitespace/EOF fixes and isort updatesJordan Cook2021-08-081-1/+1
|
* Some serialization fixes & updates:Jordan Cook2021-07-031-3/+0
| | | | | | | | | | | | | | | | | * Fix tests on python 3.6: * Make `cattrs` optional again * Don't run tests for serializers with missing optional dependencies * Show any skipped tests in pytest output * Fix redirect serialization for backends that serialize all values (DynamoDB and Redis) * Otherwise, the redirect value (which is just another key) will get converted into a `CachedResponse` * Make `pickle` serializer use `cattrs` if installed * Make `bson` serializer compatible with both `pymongo` version and standalone `bson` library * Split up `CattrStage` and preconf converters into separate modules * Turn preconf converters into `Stage` objects * Add `DeprecationWarning` for previous method of using `itsdangerous`, now that there's a better way to initialize it via `SerializerPipeline` * Remove `suppress_warnings` kwarg that's now unused * Make `SerializerPipeline`, `Stage`, and `CattrStage` importable from top-level package (`from requests_cache import ...`) * Add some more details to docs and docstrings
* Add automated tests for cache behavior after version upgradesJordan Cook2021-06-201-0/+5
|
* For Windows compatibility, use multiprocessing timeouts instead of process ↵Jordan Cook2021-06-031-5/+1
| | | | signals with timeout_decorator
* escape error caused by lack of Windows compatibility in timeout_decoratorParker Hancock2021-05-281-0/+4
|
* Add support for using request and response cache headers to set cache expirationJordan Cook2021-05-071-2/+12
|
* Make sure all tests with SQLite dbs clean up after themselvesJordan Cook2021-04-291-0/+7
|
* Add raise_for_status optionJordan Cook2021-04-231-0/+6
|
* Combine test_cache.py with BaseCacheTest to run these tests for all backendsJordan Cook2021-04-221-0/+17
|
* Reorganize backend integration tests and add some more thorough testsJordan Cook2021-04-221-2/+10
|
* Run multi-threaded tests for all backends, and run with more threads & ↵Jordan Cook2021-04-201-5/+16
| | | | iterations for merges to master
* Use pytest-order to order tests; remove ipdb recommendationJordan Cook2021-04-191-2/+1
|
* Add some more info about testingJordan Cook2021-04-181-6/+10
|
* Update all backend-specific integration tests to fail quickly if not set up, ↵Jordan Cook2021-04-121-0/+22
| | | | rarther than silently ignoring or hanging
* Add option to use pytest-httpbin instead of httpbin containerJordan Cook2021-04-121-3/+29
|
* Split 'core' module into 'session' and 'patcher' modules; keep placeholder ↵Jordan Cook2021-04-021-1/+1
| | | | 'core' module for backwards-compatibility
* Improve backend initialization:Jordan Cook2021-04-021-1/+1
| | | | | | | * Also allow passing a backend class (in addition to backend name and instance) * Detect duplicate params: Backends have different keyword args equivalent to the `cache_name` positional arg, for example `db_name`. If one of these is passed as a keyword arg, it results in a `TypeError` due to duplicate args (See #94). * For backends without dependencies installed, use a placeholder class to delay and re-raise the original `ImportError` * Add type annotations
* Add tests against httpbin container for all supported methods and response ↵Jordan Cook2021-03-311-1/+16
| | | | formats
* Convert test_thread_safety and test_monkey_patch from TestCase classes to ↵Jordan Cook2021-03-311-0/+17
| | | | pytest-style tests
* Split tests into unit and integration tests and run separately in CI; update ↵Jordan Cook2021-03-311-1/+0
| | | | Contributing Guide with more notes on testing
* Add mocking for requests with redirect historyJordan Cook2021-03-311-2/+24
|
* Also remove invalid responses when running remove_expired_responses()Jordan Cook2021-03-301-0/+1
|
* Add and rewrite unit tests for CachedSession and CachedResponse using ↵Jordan Cook2021-03-221-0/+73
requests-mock and fixtures