summaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2021-04-11 21:26:31 -0500
committerJordan Cook <jordan.cook@pioneer.com>2021-04-12 13:02:01 -0500
commit0d1bceed7a3a06dcd49dab63ba72bd2b8ace77fa (patch)
treea41b53224d7649a471282cd48dce34ea04e30832 /CONTRIBUTING.md
parentf3c6eae9d19f5b98b0d39b68198dba9cd433e8ea (diff)
downloadrequests-cache-0d1bceed7a3a06dcd49dab63ba72bd2b8ace77fa.tar.gz
Add option to use pytest-httpbin instead of httpbin container
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md22
1 files changed, 18 insertions, 4 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 72c7539..0f68c92 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -58,10 +58,10 @@ $ pre-commit uninstall
* Run `./runtests.sh` to run all tests with some useful options for test coverage reports,
multiprocessing, and debugging.
-### Integration Tests
-Live databases are required to run integration tests, and docker-compose config is included to make
-this easier. First, [install docker](https://docs.docker.com/get-docker/) and
-[install docker-compose](https://docs.docker.com/compose/install/).
+### Integration Test Containers
+A live web server and backend databases are required to run integration tests, and docker-compose
+config is included to make this easier. First, [install docker](https://docs.docker.com/get-docker/)
+and [install docker-compose](https://docs.docker.com/compose/install/).
Then, run:
```bash
@@ -69,6 +69,20 @@ $ docker-compose up -d
pytest tests/integration
```
+### Integration Test Alternatives
+If you can't easily run Docker containers in your environment but still want to run some of the
+integration tests, you can use [pytest-httpbin](https://github.com/kevin1024/pytest-httpbin) instead
+of the httpbin container. This just requires installing an extra package and setting an environment
+variable:
+```bash
+pip install pytest-httpbin
+export USE_PYTEST_HTTPBIN=true
+pytest tests/integration/test_cache.py
+```
+
+For backend databases, you can install and run them on the host instead of in a container, as long
+as they are running on the default port.
+
## Debugging
When you run into issues while working on new features and/or tests, it will make your life much easier
to use a debugger instead of `print` statements. Most IDEs have a built-in debugger, but if