-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Added --aggregate option to attach
Added a unit and an integration test for the --aggregate option. The unit test tests the case when --aggregate is given but --output is not. The --aggregate option is tested in the integration test. Signed-off-by: Ivona Stojanovic <[email protected]>
- Loading branch information
1 parent
01f4121
commit 3c5852e
Showing
2 changed files
with
118 additions
and
26 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
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 |