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

2.2.1 testunit error #1157

Closed
nunotexbsd opened this issue Jul 21, 2024 · 6 comments · Fixed by #1159
Closed

2.2.1 testunit error #1157

nunotexbsd opened this issue Jul 21, 2024 · 6 comments · Fixed by #1159

Comments

@nunotexbsd
Copy link

1 error on testunit that I can't figure out if it is missing some dependency.

Any clues?
Thanks

platform freebsd15 -- Python 3.11.9, pytest-8.1.1, pluggy-1.5.0 -- /usr/local/bin/python3.11
cachedir: .pytest_cache
rootdir: /wrkdirs/usr/ports/multimedia/py-subliminal/work-py311/subliminal-2.2.1
configfile: pyproject.toml
testpaths: tests
collected 367 items / 1 error

====================================================================================================== ERRORS ======================================================================================================
_______________________________________________________________________________________ ERROR collecting tests/test_score.py _______________________________________________________________________________________
ImportError while importing test module '/wrkdirs/usr/ports/multimedia/py-subliminal/work-py311/subliminal-2.2.1/tests/test_score.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_score.py:7: in <module>
    from subliminal.score import compute_score, episode_scores, movie_scores, solve_episode_equations, solve_movie_equations
E   ImportError: cannot import name 'solve_episode_equations' from 'subliminal.score' (/wrkdirs/usr/ports/multimedia/py-subliminal/work-py311/subliminal-2.2.1/subliminal/score.py)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================================= 1 error in 0.16s =================================================================================================
*** Error code 2
@getzze
Copy link
Collaborator

getzze commented Jul 21, 2024 via email

@nunotexbsd
Copy link
Author

@getzze

That was a missing dep that I missed from pyproject.py. It works now.

I could close this PR right away as fixed but in the meanwhile maybe it is worth to take a look at 1 failed test:

===================================================================================================== FAILURES =====================================================================================================
____________________________________________________________________________________________ test_refine_video_metadata ____________________________________________________________________________________________

mkv = {'test1': '/wrkdirs/usr/ports/multimedia/py-subliminal/work-py311/subliminal-2.2.1/tests/data/mkv/test1.mkv', 'test2':...mkv', 'test4': '/wrkdirs/usr/ports/multimedia/py-subliminal/work-py311/subliminal-2.2.1/tests/data/mkv/test4.mkv', ...}

    def test_refine_video_metadata(mkv):
        scanned_video = scan_video(mkv['test5'])
        refine(scanned_video, episode_refiners=('metadata',), movie_refiners=('metadata',))
        assert type(scanned_video) is Movie
        assert scanned_video.name == mkv['test5']
        assert scanned_video.source is None
>       assert scanned_video.release_group is None
E       AssertionError: assert 'subliminal' is None
E        +  where 'subliminal' = <Movie [2 2 1]>.release_group

tests/test_core.py:254: AssertionError
============================================================================================= short test summary info ==============================================================================================
SKIPPED [1] tests/providers/test_addic7ed.py:203: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:216: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:225: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:302: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:311: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:320: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:329: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:338: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:347: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:356: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:368: unconditional skip
SKIPPED [1] tests/providers/test_addic7ed.py:380: unconditional skip
SKIPPED [1] tests/providers/test_opensubtitles.py:200: authorization no longer works on the old API
SKIPPED [1] tests/providers/test_opensubtitles.py:234: authorization no longer works on the old API
SKIPPED [1] tests/providers/test_opensubtitles.py:296: query by tag currently broken on opensubtitles
SKIPPED [1] tests/providers/test_opensubtitles.py:458: query by tag currently broken on opensubtitles
SKIPPED [1] tests/test_core.py:666: only on linux platform
SKIPPED [1] tests/test_core.py:676: only on linux platform
SKIPPED [1] tests/test_core.py:686: only on linux platform
SKIPPED [1] tests/test_core.py:693: only on linux platform
SKIPPED [1] tests/test_core.py:700: only on linux platform
============================================================================== 1 failed, 351 passed, 21 skipped, 1 xfailed in 50.24s ===============================================================================
*** Error code 1

@getzze
Copy link
Collaborator

getzze commented Jul 21, 2024

You can leave this issue open until CONTRIBUTING.md is modified, so the issue is tracked.

The test failure looks like a duplicate of #1135

The release_group is parsed as "subliminal" by scan_video. But the filename is just "test5.mkv". Something seems wrong with the scan, it's using the full path.

@getzze
Copy link
Collaborator

getzze commented Jul 21, 2024

Can you return the result of:

from guessit import guessit
path = "/wrkdirs/usr/ports/multimedia/py-subliminal/work-py311/subliminal-2.2.1/tests/data/mkv/test5.mkv"
guessit(path)

@nunotexbsd
Copy link
Author

Python 3.11.9 (main, Jul 11 2024, 12:08:02) [Clang 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2 on freebsd15
Type "help", "copyright", "credits" or "license" for more information.
>>> from guessit import guessit
>>> path = "/wrkdirs/usr/ports/multimedia/py-subliminal/work-py311/subliminal-2.2.1/tests/data/mkv/test5.mkv"
>>> guessit(path)
MatchesDict([('release_group', 'subliminal'), ('title', '2 2 1'), ('container', 'mkv'), ('type', 'movie')])

@getzze
Copy link
Collaborator

getzze commented Jul 22, 2024

Follow discussion in #1135 for the failing test.

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

Successfully merging a pull request may close this issue.

2 participants