pytest-dev / unittest2pytest

helps rewriting Python `unittest` test-cases into `pytest` test-cases
GNU General Public License v3.0
128 stars 27 forks source link

Installer issue #20

Closed joshthoward closed 7 years ago

joshthoward commented 7 years ago

I am running into the following issue trying to install the package from the master branch.

$ unittest2pytest -l
Available transformations for the -f/--fix option:
Traceback (most recent call last):
  File "/Users/jhoward/homebrew/bin/unittest2pytest", line 11, in <module>
    load_entry_point('unittest2pytest==0.3', 'console_scripts', 'unittest2pytest')()
  File "build/bdist.macosx-10.12-x86_64/egg/unittest2pytest/__main__.py", line 30, in main
  File "/Users/jhoward/homebrew/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib2to3/main.py", line 199, in main
    for fixname in refactor.get_all_fix_names(fixer_pkg):
  File "/Users/jhoward/homebrew/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib2to3/refactor.py", line 38, in get_all_fix_names
    for name in sorted(os.listdir(fixer_dir)):
OSError: [Errno 20] Not a directory: '/Users/jhoward/homebrew/lib/python2.7/site-packages/unittest2pytest-0.3-py2.7.egg/unittest2pytest/fixes'
htgoebel commented 7 years ago

Which command did you use to install the program, which Python distribution are you using? Also use pip show unittest2pytest to see if pip "knows" these files.

joshthoward commented 7 years ago

I am using python 2.7. Here is the pip show unittest2pytest output:

Name: unittest2pytest
Version: 0.3
Summary: Convert unittest test-cases to pytest
Home-page: https://github.com/pytest-dev/unittest2pytest
Author: Hartmut Goebel
Author-email: h.goebel@crazy-compilers.com
License: GPLv3+
Location: /Users/jhoward/homebrew/lib/python2.7/site-packages/unittest2pytest-0.3-py2.7.egg
Requires:
RonnyPfannschmidt commented 7 years ago

at first glance this looks like there was a zipped egg install (people should use pip these days) to redeem, i think a zip_safe=False flag is needed

joshthoward commented 7 years ago

@RonnyPfannschmidt

That works, Thanks! I added a pull request to get this updated.