Skip to content

Commit

Permalink
Clarify what is meant by allocating memory
Browse files Browse the repository at this point in the history
  • Loading branch information
itamarst authored and pablogsal committed Mar 26, 2024
1 parent 26b5ac6 commit 286bf78
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ that can be used to enforce additional checks and validations on tests.

.. py:function:: pytest.mark.limit_memory(memory_limit: str)
Fail the execution of the test if the test allocates more memory than allowed.
Fail the execution of the test if the test allocates more peak memory than allowed.

When this marker is applied to a test, it will cause the test to fail if the
execution of the test allocates more memory than allowed. It takes a single argument
with a string indicating the maximum memory that the test can allocate.
execution of the test allocates more memory (at the peak/high watermark) than allowed.
It takes a single argument with a string indicating the maximum memory that the test
can allocate.

The format for the string is ``<NUMBER> ([KMGTP]B|B)``. The marker will raise
``ValueError`` if the string format cannot be parsed correctly.
Expand Down

0 comments on commit 286bf78

Please sign in to comment.