-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d690638
commit 522954c
Showing
3 changed files
with
35 additions
and
6 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
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,26 @@ | ||
import pytest | ||
from arger import Arger | ||
|
||
from .examples.doc_types import google_doc | ||
|
||
|
||
@pytest.fixture | ||
def arg(): | ||
return Arger("Test") | ||
|
||
|
||
def test_noargs(capsys, arg): | ||
"""Ensure a method that expects no arguments runs properly when it receives | ||
none.""" | ||
arg(google_doc) # equivalent of calling with decorator | ||
with pytest.raises(SystemExit): | ||
arg.dispatch() # start function | ||
|
||
capture = capsys.readouterr() | ||
assert ( | ||
capture.err | ||
== """\ | ||
usage: pytest [-h] [-k KW1] [-w] param1 param2 | ||
pytest: error: the following arguments are required: param1, param2 | ||
""" | ||
) |