Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail with python-3.3.2 #71

Closed
Nikoli opened this issue Dec 7, 2013 · 5 comments
Closed

Tests fail with python-3.3.2 #71

Nikoli opened this issue Dec 7, 2013 · 5 comments

Comments

@Nikoli
Copy link

Nikoli commented Dec 7, 2013

0.6.2 and 829f789 fail tests with python-3.3.2:

test_screenSize (guessit.test.test_quality.TestQuality) ... Traceback (most recent call last):
  File "setup.py", line 74, in <module>
    setup(**args)
  File "/usr/lib64/python3.3/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.3/distutils/dist.py", line 929, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.3/distutils/dist.py", line 948, in run_command
    cmd_obj.run()
  File "/usr/lib64/python3.3/site-packages/setuptools/command/test.py", line 138, in run
    self.with_project_on_sys_path(self.run_tests)
  File "/usr/lib64/python3.3/site-packages/setuptools/command/test.py", line 118, in with_project_on_sys_path
    func()
  File "/usr/lib64/python3.3/site-packages/setuptools/command/test.py", line 164, in run_tests
    testLoader = cks
  File "/usr/lib64/python3.3/unittest/main.py", line 124, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python3.3/unittest/main.py", line 168, in parseArgs
    self.createTests()
  File "/usr/lib64/python3.3/unittest/main.py", line 175, in createTests
    self.module)
  File "/usr/lib64/python3.3/unittest/loader.py", line 137, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python3.3/unittest/loader.py", line 137, in <listcomp>
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python3.3/unittest/loader.py", line 108, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/usr/lib64/python3.3/site-packages/setuptools/command/test.py", line 35, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/usr/lib64/python3.3/unittest/loader.py", line 105, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'test_utils'

babelfish, nose, pyyaml are installed.

@Nikoli
Copy link
Author

Nikoli commented Dec 7, 2013

With 'python .travis.runtests.py' all tests work fine with both python-2.7 and python-3.3, but https://pypi.python.org/packages/source/g/guessit/guessit-0.6.2.tar.gz#md5=581162e417d0c3f35534fcb2ea91a72d does not have .travis.runtests.py, please upload github generated tar to pypi.

@Nikoli
Copy link
Author

Nikoli commented Dec 7, 2013

Found other problems with tests

  1. 'python .travis.runtests.py' does not exit with non zero code when something fails, that why travis does not inform you about broken tests.
  2. path to several files is wrong, you forgot to update it in commit b5bff63
test_splitpath (guessit.test.test_utils.TestUtils) ... ok
Doctest: guessit.guess_file_info ... WARNING  [guessit:guess_file_info] -- Could not compute hash because: [Errno 2] No such file or directory: u'tests/dummy.srt'
FAIL

======================================================================
FAIL: Doctest: guessit.hash_ed2k.hash_file
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python2.7/doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for guessit.hash_ed2k.hash_file
  File "/var/package-manager/tmp/portage/dev-python/guessit-0.6.2/work/guessit-0.6.2/guessit/hash_ed2k.py", line 27, in hash_file

----------------------------------------------------------------------
File "/var/package-manager/tmp/portage/dev-python/guessit-0.6.2/work/guessit-0.6.2/guessit/hash_ed2k.py", line 30, in guessit.hash_ed2k.hash_file
Failed example:
    s(hash_file('tests/dummy.srt'))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib64/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest guessit.hash_ed2k.hash_file[0]>", line 1, in <module>
        s(hash_file('tests/dummy.srt'))
      File "/var/package-manager/tmp/portage/dev-python/guessit-0.6.2/work/guessit-0.6.2/guessit/hash_ed2k.py", line 34, in hash_file
        os.path.getsize(filename),
      File "/usr/lib64/python2.7/genericpath.py", line 49, in getsize
        return os.stat(filename).st_size
    OSError: [Errno 2] No such file or directory: 'tests/dummy.srt'


======================================================================
FAIL: Doctest: guessit.guess_file_info
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python2.7/doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for guessit.guess_file_info
  File "/var/package-manager/tmp/portage/dev-python/guessit-0.6.2/work/guessit-0.6.2/guessit/__init__.py", line 198, in guess_file_info

----------------------------------------------------------------------
File "/var/package-manager/tmp/portage/dev-python/guessit-0.6.2/work/guessit-0.6.2/guessit/__init__.py", line 202, in guessit.guess_file_info
Failed example:
    guess_file_info('tests/dummy.srt', 'autodetect', info = ['hash_md5', 'hash_sha1'])
Expected:
    {'hash_md5': 'e781de9b94ba2753a8e2945b2c0a123d', 'hash_sha1': 'bfd18e2f4e5d59775c2bc14d80f56971891ed620'}
Got:
    {}

-------------------- >> begin captured logging << --------------------
guessit: WARNING: Could not compute hash because: [Errno 2] No such file or directory: u'tests/dummy.srt'
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 31 tests in 2.369s

FAILED (failures=2)
/usr/bin/python2.7: can't open file 'tests/test_episode.py': [Errno 2] No such file or directory
/usr/bin/python2.7: can't open file 'tests/test_movie.py': [Errno 2] No such file or directory
/usr/bin/python2.7: can't open file 'tests/test_autodetect.py': [Errno 2] No such file or directory
/usr/bin/python2.7: can't open file 'tests/test_autodetect_all.py': [Errno 2] No such file or directory
/usr/bin/python2.7: can't open file 'tests/test_language.py': [Errno 2] No such file or directory
/usr/bin/python2.7: can't open file 'tests/test_utils.py': [Errno 2] No such file or directory
/usr/bin/python2.7: can't open file 'tests/test_matchtree.py': [Errno 2] No such file or directory

@Toilal
Copy link
Member

Toilal commented Dec 8, 2013

Thank you for the report and analysis, i'll try to fix those problems asap.

@Toilal
Copy link
Member

Toilal commented Dec 10, 2013

Those issues are fixed with 16d3d53. There is still an issue with Python3 and BabelFish (Diaoul/babelfish#7).

@Toilal Toilal closed this as completed Dec 11, 2013
@Nikoli
Copy link
Author

Nikoli commented Dec 11, 2013

Exit code and paths seem correct now, but tests still fail: issue #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants