-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
--aggregate
option to memray attach
Add --aggregate option which allows user to request aggregated mode for in-memory aggregation. Signed-off-by: Ivona Stojanovic <[email protected]>
- Loading branch information
1 parent
514af3e
commit 689b8c3
Showing
4 changed files
with
112 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
``memray attach`` now supports ``--aggregate`` to produce :ref:`aggregated capture files <aggregated capture files>`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from unittest.mock import patch | ||
|
||
import pytest | ||
|
||
from memray.commands import main | ||
|
||
|
||
@patch("memray.commands.attach.debugger_available") | ||
class TestAttachSubCommand: | ||
def test_memray_attach_aggregated_without_output_file( | ||
self, is_debugger_available_mock, capsys | ||
): | ||
# GIVEN | ||
is_debugger_available_mock.return_value = True | ||
|
||
# WHEN | ||
with pytest.raises(SystemExit): | ||
main(["attach", "--aggregate", "1234"]) | ||
|
||
captured = capsys.readouterr() | ||
assert "Can't use aggregated mode without an output file." in captured.err |