File size increase in 6.4.3 when using dynamic_context · Issue #1586 · nedbat/coveragepy (original) (raw)
Describe the bug
Hi. I suspect this is related to #1538, hence the similar name, but this is a different aspect. My symptom is a huge increase in coverage data file size (~4 -> 200Mb)
To Reproduce
I made a test project with 3 pytest files ,each with a single empty test, and added dynamic_context = test_function
to a coveragerc
running pytest under coverage and then reading the line_bits table, i get
(coverage run -m pytest tests/ ; sqlite3 .coverage 'select path, context from line_bits join file on file_id = file.id join context on context_id = context.id'
)
on 6.4.2
tests/test_1.py|
tests/test_1.py|test_1.test1
tests/test_2.py|
tests/test_2.py|test_2.test2
tests/test_3.py|
tests/test_3.py|test_3.test3
on 6.4.3
tests/test_1.py|
tests/test_1.py|test_1.test1
tests/test_1.py|test_2.test2
tests/test_1.py|test_3.test3
tests/test_2.py|
tests/test_2.py|test_1.test1
tests/test_2.py|test_2.test2
tests/test_2.py|test_3.test3
tests/test_3.py|
tests/test_3.py|test_1.test1
tests/test_3.py|test_2.test2
tests/test_3.py|test_3.test3
It looks like there is now a line for every file for every context.
Is this expected? Avoidable? The fix for #1538 seems to focus on queries. does that mean we can't avoid storing the extra data in the first place?