gif-for-cli icon indicating copy to clipboard operation
gif-for-cli copied to clipboard

Error: get error in testing

Open danghai opened this issue 6 years ago • 4 comments

I got error in testing after command: python3 -m unittest discover

danghai@ubuntu:~/test/gif-for-cli$ python3 -m unittest discover

..................................EE..........
======================================================================
ERROR: tests.test_export (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_export
Traceback (most recent call last):
  File "/usr/lib/python3.5/unittest/loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.5/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "/home/danghai/test/gif-for-cli/tests/test_export.py", line 22, in <module>
    from gif_for_cli.export import _export_txt_frames, _get_txt_frames, _run_ffmpeg, export, export_txt_frame
  File "/home/danghai/test/gif-for-cli/gif_for_cli/export.py", line 23, in <module>
    from . import third_party
ImportError: cannot import name 'third_party'


======================================================================
ERROR: tests.test_main (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_main
Traceback (most recent call last):
  File "/usr/lib/python3.5/unittest/loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.5/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "/home/danghai/test/gif-for-cli/tests/test_main.py", line 21, in <module>
    from gif_for_cli.__main__ import execute
  File "/home/danghai/test/gif-for-cli/gif_for_cli/__main__.py", line 25, in <module>
    from .export import export
  File "/home/danghai/test/gif-for-cli/gif_for_cli/export.py", line 23, in <module>
    from . import third_party
ImportError: cannot import name 'third_party'


----------------------------------------------------------------------
Ran 46 tests in 0.035s

FAILED (errors=2)

danghai avatar Jun 19 '18 08:06 danghai

Since this was first written there have been some changes to the code that require setup.py to be run. Does python3 setup.py test work for you?

SeanHayes avatar Jul 16 '18 18:07 SeanHayes

yeah python3 setup.py test works for me

danghai avatar Jul 17 '18 17:07 danghai

I had the same problem with the third_party import. Couldn't figure it out yet.

diego-rapoport avatar Apr 21 '21 21:04 diego-rapoport

I had the same problem with the third_party import. Couldn't figure it out yet.

rm gif_for_cli/third_party 
cp third_party gif_for_cli/third_party  -r

7-Leaf avatar Aug 30 '22 06:08 7-Leaf