Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Remove pytest-datadir (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
leezu authored and szha committed Jul 16, 2018
1 parent a61743b commit 4661366
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion env/py2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ dependencies:
- pytest
- flaky
- pytest-cov
- pytest-datadir
- pip:
- mxnet-cu80>=1.3.0b20180629
1 change: 0 additions & 1 deletion env/py3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ dependencies:
- pytest
- flaky
- pytest-cov
- pytest-datadir
- pip:
- mxnet-cu80>=1.3.0b20180629
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def find_version(*file_paths):
],
'dev': [
'pytest',
'pytest-datadir',
'recommonmark',
'sphinx-gallery',
'sphinx_rtd_theme',
Expand Down
8 changes: 5 additions & 3 deletions tests/unittest/train/test_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ def test_fasttext_embedding(sparse_grad, hybridize, wordsmask, subwordsmask):
loss.asnumpy()


def test_fasttext_embedding_load_binary_compare_vec(datadir):
def test_fasttext_embedding_load_binary_compare_vec():
test_dir = os.path.dirname(os.path.realpath(__file__))
token_embedding_vec = nlp.embedding.TokenEmbedding.from_file(
os.path.join(str(datadir), 'lorem_ipsum.vec'), unknown_token=None)
os.path.join(str(test_dir), 'test_embedding', 'lorem_ipsum.vec'),
unknown_token=None)

model = nlp.model.train.FasttextEmbeddingModel.load_fasttext_format(
os.path.join(str(datadir), 'lorem_ipsum.bin'))
os.path.join(str(test_dir), 'test_embedding', 'lorem_ipsum.bin'))
idx_to_vec = model[token_embedding_vec.idx_to_token]
assert np.all(
np.isclose(a=token_embedding_vec.idx_to_vec.asnumpy(),
Expand Down

0 comments on commit 4661366

Please sign in to comment.