From cd7fdfcbef1ca6e9fc389e0bb3cb9060d4f7ae00 Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Wed, 24 Jan 2024 16:06:36 +0100 Subject: [PATCH] Test new type metadata --- CONTRIBUTING.md | 2 +- setup.cfg | 5 +++-- tasks.py | 4 ++-- test/base_test.py | 31 ++++++++++++++++++++++++++----- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 355e641..c573ae6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ pip install -e .[dev] ``` -will install `h5grove` in editable mode with all the linting/formating/testing packages. This will also install the [flask](https://flask.palletsprojects.com/en/) and [tornado](https://www.tornadoweb.org/en/stable/) packages as they are needed to build the documentation. +will install `h5grove` in editable mode with all the linting/formating/testing packages. This will also install the [fastapi](https://fastapi.tiangolo.com/), [flask](https://flask.palletsprojects.com/en/) and [tornado](https://www.tornadoweb.org/en/stable/) packages as they are needed to build the documentation and test the project. ## Linting diff --git a/setup.cfg b/setup.cfg index d8d1ee5..aebce7e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,7 @@ install_requires = [options.extras_require] fastapi = - fastapi + fastapi pydantic > 2 pydantic-settings uvicorn @@ -35,7 +35,7 @@ flask = Flask-Compress Flask-Cors tornado = - tornado + tornado dev = black bump2version @@ -43,6 +43,7 @@ dev = flake8 h5grove[fastapi] h5grove[flask] + h5grove[tornado] invoke mypy myst-parser diff --git a/tasks.py b/tasks.py index 0a2fa1b..a80eca1 100644 --- a/tasks.py +++ b/tasks.py @@ -32,9 +32,9 @@ def lint(c): @task -def test(c): +def test(c, verbose=False, keyword=""): """Test without benchmark""" - c.run("pytest --benchmark-skip") + c.run("pytest --benchmark-skip" + (" -vv" if verbose else "") + ((" -k" + keyword) if keyword else "")) @task diff --git a/test/base_test.py b/test/base_test.py index b07ad1f..162a4ce 100644 --- a/test/base_test.py +++ b/test/base_test.py @@ -134,11 +134,11 @@ def test_meta_on_chunked_compressed_dataset(self, server): assert content == { "attributes": [], "chunks": [5, 5], - "dtype": "