diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index db58154..cdfea6f 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -43,7 +43,7 @@ jobs: python -m pytest - name: Send status to author's email if: ${{ failure() }} && github.event_name != 'workflow_dispatch' }} # Only email if the workflow failed and was not manually started. Customize this as necessary. - uses: dawidd6/action-send-mail@main + uses: dawidd6/action-send-mail@master with: # Required mail server address if not connection_url: server_address: smtp.gmail.com diff --git a/src/benchmarking_asv/example_module.py b/src/benchmarking_asv/example_module.py index 65102fe..951e926 100644 --- a/src/benchmarking_asv/example_module.py +++ b/src/benchmarking_asv/example_module.py @@ -28,7 +28,9 @@ def meaning() -> int: def run_time_computation(): """Mock function for random time computation.""" - time.sleep(random.uniform(0, 4)) + sleep_time = random.uniform(0, 4) + time.sleep(sleep_time) + return sleep_time def run_mem_computation(): diff --git a/tests/benchmarking_asv/test_example_module.py b/tests/benchmarking_asv/test_example_module.py index 96acc2f..8c0ab54 100644 --- a/tests/benchmarking_asv/test_example_module.py +++ b/tests/benchmarking_asv/test_example_module.py @@ -13,3 +13,13 @@ def test_meaning() -> None: """Verify the output of the `meaning` function""" output = example_module.meaning() assert output == 42 + + +def test_run_time_computation() -> None: + output = example_module.run_time_computation() + assert 0 <= output <= 4 + + +def test_mem_computation() -> None: + output = example_module.run_mem_computation() + assert 0 <= len(output) <= 512