-
Notifications
You must be signed in to change notification settings - Fork 587
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
8 changed files
with
359 additions
and
77 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
16 changes: 16 additions & 0 deletions
16
hypothesis-python/tests/ghostwriter/recorded/eval_equivalent.txt
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,16 @@ | ||
# This test code was written by the `hypothesis.extra.ghostwriter` module | ||
# and is provided under the Creative Commons Zero public domain dedication. | ||
|
||
import ast | ||
from hypothesis import given, strategies as st | ||
|
||
# TODO: replace st.nothing() with an appropriate strategy | ||
|
||
|
||
@given( | ||
globals=st.none(), locals=st.none(), node_or_string=st.text(), source=st.nothing() | ||
) | ||
def test_equivalent_eval_literal_eval(globals, locals, node_or_string, source): | ||
result_eval = eval(source, globals, locals) | ||
result_literal_eval = ast.literal_eval(node_or_string=node_or_string) | ||
assert result_eval == result_literal_eval, (result_eval, result_literal_eval) |
15 changes: 15 additions & 0 deletions
15
hypothesis-python/tests/ghostwriter/recorded/sorted_idempotent.txt
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,15 @@ | ||
# This test code was written by the `hypothesis.extra.ghostwriter` module | ||
# and is provided under the Creative Commons Zero public domain dedication. | ||
|
||
from hypothesis import given, strategies as st | ||
|
||
|
||
@given( | ||
iterable=st.one_of(st.iterables(st.integers()), st.iterables(st.text())), | ||
key=st.none(), | ||
reverse=st.booleans(), | ||
) | ||
def test_idempotent_sorted(iterable, key, reverse): | ||
result = sorted(iterable, key=key, reverse=reverse) | ||
repeat = sorted(result, key=key, reverse=reverse) | ||
assert result == repeat, (result, repeat) |
Oops, something went wrong.