File tree Expand file tree Collapse file tree 5 files changed +18
-19
lines changed Expand file tree Collapse file tree 5 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -60,4 +60,4 @@ Example of usage:
60
60
61
61
@pytest.mark.limit_memory (" 24 MB" )
62
62
def test_foobar ():
63
- pass # do some stuff that allocates memory
63
+ pass # do some stuff that allocates memory
Original file line number Diff line number Diff line change 1
1
[build-system ]
2
2
build-backend = " hatchling.build"
3
- requires = [" hatchling>=1.8 " , " hatch-vcs>=0.2" ]
3
+ requires = [" hatchling>=1.11.1 " , " hatch-vcs>=0.2" ]
4
4
5
5
[project ]
6
6
name = " pytest-memray"
@@ -19,29 +19,29 @@ maintainers = [
19
19
]
20
20
requires-python = " >=3.8"
21
21
dependencies = [
22
- " pytest>=7.1. 2" ,
23
- " memray>=1.3 " ,
22
+ " pytest>=7.2" ,
23
+ " memray>=1.4.1 " ,
24
24
]
25
25
optional-dependencies.docs = [
26
- " furo>=2022.6.21 " ,
27
- " sphinx>=5.1.1 " ,
28
- " sphinx-argparse>=0.3.1 " ,
26
+ " furo>=2022.9.29 " ,
27
+ " sphinx>=5.3 " ,
28
+ " sphinx-argparse>=0.4 " ,
29
29
" sphinx-inline-tabs>=2022.1.2b11" ,
30
30
" sphinxcontrib-programoutput>=0.17" ,
31
- " towncrier>=21.9 " ,
31
+ " towncrier>=22.8 " ,
32
32
]
33
33
optional-dependencies.lint = [
34
- " black==22.6 " ,
35
- " flake8==5.0.4 " ,
34
+ " black==22.10 " ,
35
+ " flake8==6 " ,
36
36
" isort==5.10.1" ,
37
- " mypy==0.971 " ,
37
+ " mypy==0.991 " ,
38
38
]
39
39
optional-dependencies.test = [
40
40
" covdefaults>=2.2" ,
41
- " pytest>=7.1. 2" ,
42
- " coverage>=6.4.4 " ,
43
- " flaky>=3.7.0 " ,
44
- " pytest-xdist>=3" ,
41
+ " pytest>=7.2" ,
42
+ " coverage>=6.5 " ,
43
+ " flaky>=3.7" ,
44
+ " pytest-xdist>=3.0.2 " ,
45
45
]
46
46
dynamic = [" version" ]
47
47
classifiers = [
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
3
from dataclasses import dataclass
4
- from typing import Optional
5
4
from typing import Tuple
6
5
7
6
from memray import AllocationRecord
@@ -48,7 +47,7 @@ def long_repr(self) -> str:
48
47
49
48
def limit_memory (
50
49
limit : str , * , _allocations : list [AllocationRecord ]
51
- ) -> Optional [ _MemoryInfo ] :
50
+ ) -> _MemoryInfo | None :
52
51
"""Limit memory used by the test."""
53
52
max_memory = parse_memory_string (limit )
54
53
total_allocated_memory = sum (record .size for record in _allocations )
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ def pytest_runtest_makereport(
184
184
continue
185
185
reader = FileReader (result .result_file )
186
186
func = reader .get_high_watermark_allocation_records
187
- allocations = list (( func (merge_threads = True ) ))
187
+ allocations = list (func (merge_threads = True ))
188
188
res = marker_fn (* marker .args , ** marker .kwargs , _allocations = allocations )
189
189
if res :
190
190
report .outcome = "failed"
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ setenv =
60
60
basepython = python3.10
61
61
skip_install = true
62
62
deps =
63
- towncrier>=21.9
63
+ towncrier>=22.8
64
64
commands =
65
65
make gen_news VERSION ={posargs}
66
66
You can’t perform that action at this time.
0 commit comments