-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
9 changed files
with
79 additions
and
38 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
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
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,39 @@ | ||
# pylint: disable=unused-variable,expression-not-assigned | ||
|
||
import pytest | ||
|
||
from expecter import expect | ||
from tests.utils import fail_msg | ||
|
||
|
||
def describe_expect(): | ||
def it_can_expect_equality(): | ||
expect(2) == 1 + 1 | ||
|
||
def _fails(): | ||
expect(1) == 2 | ||
|
||
with pytest.raises(AssertionError): | ||
_fails() | ||
assert fail_msg(_fails) == 'Expected 2 but got 1' | ||
|
||
def it_can_compare_bytes(): | ||
null = bytes((0,)) | ||
expect(null) == null | ||
data = bytes(range(9, 32)) | ||
|
||
def _fails(): | ||
expect(data) == data + null | ||
|
||
with pytest.raises(AssertionError): | ||
_fails() | ||
|
||
def it_can_expect_inequality(): | ||
expect(1) != 2 | ||
|
||
def _fails(): | ||
expect(1) != 1 | ||
|
||
with pytest.raises(AssertionError): | ||
_fails() | ||
assert fail_msg(_fails) == 'Expected anything except 1 but got it' |
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
File renamed without changes.