diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 658baafff..1c08ee39b 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -65,6 +65,12 @@ jobs: if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi - name: Type check with pyright run: pyright + - name: Run benchmarks + if: ${{ matrix.python == '3.12' }} + uses: CodSpeedHQ/action@v3 + with: + token: ${{ secrets.CODSPEED_TOKEN }} + run: pytest tests/ --codspeed - name: Test with tox run: tox -e py - name: Coveralls Parallel @@ -72,7 +78,7 @@ jobs: with: flag-name: run-${{ join(matrix.*, '-') }} parallel: true - finish: + coveralls: needs: build if: ${{ always() }} runs-on: ubuntu-latest diff --git a/test-requirements.txt b/test-requirements.txt index ec3e381ae..69fc0996f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,6 +4,7 @@ pytest-asyncio pytest-cov pytest-xdist pytest-rerunfailures +pytest-codspeed requests-mock tox setuptools diff --git a/tests/test_ws_api.py b/tests/test_ws_api.py index 20a098875..435e8904b 100644 --- a/tests/test_ws_api.py +++ b/tests/test_ws_api.py @@ -14,6 +14,12 @@ async def test_ws_api_public_endpoint(clientAsync): """Test normal order book request""" order_book = await clientAsync.ws_get_order_book(symbol="BTCUSDT") assert_ob(order_book) + + +@pytest.mark.asyncio +async def test_benchmark_ws_api_order_book(clientAsync, benchmark): + """Test normal order book request""" + await benchmark(clientAsync.ws_get_order_book, symbol="BTCUSDT") @pytest.mark.asyncio