Skip to content

Commit

Permalink
refactor: safe comparison None (#1604)
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-hoenicke committed Jan 6, 2021
1 parent 848fbcc commit 62d24c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def test_separated_workspace(test_metas):
assert not indexer.separated_workspace
assert indexer.pea_id == 0
assert indexer.workspace == './'
assert indexer.py_modules == None
assert indexer.py_modules is None
assert indexer.pea_workspace == './/None-0'
assert indexer.name.startswith('jina.executors.indexers')
6 changes: 3 additions & 3 deletions tests/unit/executors/indexers/test_binary_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@pytest.mark.parametrize('random_workspace_name', ['JINA_TEST_WORKSPACE_BINARY_PB'])
def test_binarypb_in_flow(test_metas, mocker):
docs = list(random_docs(10))

def validate(req):
mock()
assert len(docs) == len(req.docs)
Expand All @@ -23,7 +24,6 @@ def validate(req):

f = Flow(callback_on='body').add(uses='binarypb.yml')


with f:
f.index(docs)

Expand Down Expand Up @@ -117,8 +117,8 @@ def test_binarypb_delete(test_metas):
assert idxer.size == 1

with BaseIndexer.load(save_abspath) as idxer:
assert idxer.query(1) == None
assert idxer.query(2) == None
assert idxer.query(1) is None
assert idxer.query(2) is None
assert idxer.query(3) == b'random'


Expand Down

0 comments on commit 62d24c2

Please sign in to comment.