Skip to content

Failure during pytest (and solution for python3) #6

@dandelin

Description

@dandelin
foo@bar:~/foo/bar/pytorch-pretrained-BERT$ pytest -sv ./tests/
===================================================================================================================== test session starts =====================================================================================================================
platform linux -- Python 3.6.6, pytest-3.9.1, py-1.7.0, pluggy-0.8.0 -- /home/foo/.pyenv/versions/anaconda3-5.1.0/bin/python
cachedir: .pytest_cache
rootdir: /data1/users/foo/bar/pytorch-pretrained-BERT, inifile:
plugins: remotedata-0.3.0, openfiles-0.3.0, doctestplus-0.1.3, cov-2.6.0, arraydiff-0.2, flaky-3.4.0
collected 0 items / 3 errors

=========================================================================================================================== ERRORS ============================================================================================================================
___________________________________________________________________________________________________________ ERROR collecting tests/modeling_test.py ___________________________________________________________________________________________________________
ImportError while importing test module '/data1/users/foo/bar/pytorch-pretrained-BERT/tests/modeling_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/modeling_test.py:25: in <module>
    import modeling
E   ModuleNotFoundError: No module named 'modeling'
_________________________________________________________________________________________________________ ERROR collecting tests/optimization_test.py _________________________________________________________________________________________________________
ImportError while importing test module '/data1/users/foo/bar/pytorch-pretrained-BERT/tests/optimization_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/optimization_test.py:23: in <module>
    import optimization
E   ModuleNotFoundError: No module named 'optimization'
_________________________________________________________________________________________________________ ERROR collecting tests/tokenization_test.py _________________________________________________________________________________________________________
ImportError while importing test module '/data1/users/foo/bar/pytorch-pretrained-BERT/tests/tokenization_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/tokenization_test.py:22: in <module>
    import tokenization
E   ModuleNotFoundError: No module named 'tokenization'
===Flaky Test Report===


===End Flaky Test Report===
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================================================================================================== 3 error in 0.60 seconds ==================================================================================================================

In python 3, python -m pytest -sv tests/ works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions