bloomberg / bloomberg/pytest-memray
limit_memory for parametrized tests
- Dominant language
- Python
- Stars
- 423
- Forks
- 39
- Avg merge
- 5h 19m
- Merged PRs (30d)
- 1
Description
Handle parametrized tests requiring differing memory limits. Currently, these tests need to be duplicated but we could use a fixture to apply dynamic memory limit or allow limit memory to be a list of limits.
@pablogsal ideas?
```python
@pytest.mark.parametrize("count", [1, 1000])
@pytest.mark.limit_memory("1 MB") # limit differs per parameter
def test_a(count):
assert 'a' * count
```
Contributor guide
Research direction
Start by reading the pytest limit_memory marker and how it interacts with parametrized tests. Compare the fixture-based and list-of-limits approaches, then add coverage for the parametrized example; done means differing parameters can use differing memory limits without duplicating the test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100