Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement | operator on Filtering and Related. #338

Merged
merged 4 commits into from
Jul 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tests for NotImplemented on different type.
  • Loading branch information
peterschutt committed Jul 25, 2020
commit a46650f8d7a4af1c958c98eb187c0cc43c030dcd
7 changes: 7 additions & 0 deletions tests/test_filtering.py
Original file line number Diff line number Diff line change
@@ -346,3 +346,10 @@ def test_filter__or__():
assert len(union._arg_filters) == 2
assert union._arg_filters["foo"] is column_filter_foo
assert union._arg_filters["bar"] is column_filter_baz


def test_filtering__or__typeerror():
left = Filtering()
right = object()
with pytest.raises(TypeError):
left | right
7 changes: 7 additions & 0 deletions tests/test_related.py
Original file line number Diff line number Diff line change
@@ -377,3 +377,10 @@ def test_related__or__(models):
assert len(union._resolvers) == 2
assert union._resolvers["foo"] is related_foo
assert union._resolvers["bar"] is related_baz


def test_related__or__typeerror():
left = Related()
right = object()
with pytest.raises(TypeError):
left | right