diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7f88111..9cab370 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] dependencies: ["pip", "conda"] fail-fast: false @@ -53,7 +53,8 @@ jobs: if: matrix.dependencies == 'conda' run: | set -vxeo pipefail - conda install -y -c conda-forge six mongoquery doct jsonschema mock mongomock pymongo pytest pyyaml requests tornado ujson + conda install -y -c conda-forge six mongoquery doct jsonschema mock pymongo pytest pyyaml requests tornado ujson + pip install mongomock - name: Install the package run: | diff --git a/analysisstore/client/asutils.py b/analysisstore/client/asutils.py index 052e4e0..ceebd1e 100644 --- a/analysisstore/client/asutils.py +++ b/analysisstore/client/asutils.py @@ -5,8 +5,11 @@ import six +session = requests.Session() + + def get_document(url, doc_type, as_json, contents): - r = requests.get(url, params=ujson.dumps(contents)) + r = session.get(url, params=ujson.dumps(contents)) r.raise_for_status() content = ujson.loads(r.text) if as_json: @@ -18,7 +21,7 @@ def get_document(url, doc_type, as_json, contents): def post_document(url, contents): try: - r = requests.post(url, data=ujson.dumps(contents)) + r = session.post(url, data=ujson.dumps(contents)) except ConnectionError: raise ConnectionError('No AnalysisStore server found') r.raise_for_status() # this is for catching server side issue.