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

pytest fails on Travis CI Test_ImageSearcher_LikelyCover.test_write_album_image for "happy path" cases #3

Open
jtmoon79 opened this issue Mar 5, 2019 · 0 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jtmoon79
Copy link
Owner

jtmoon79 commented Mar 5, 2019

From https://travis-ci.com/jtmoon79/coverlovin2/jobs/181976062

two tests fail

coverlovin2/test/test_coverlovin2.py::Test_ImageSearcher_LikelyCover::test_write_album_image[happy path - case 1 - overwrite False] FAILED [ 51%]
coverlovin2/test/test_coverlovin2.py::Test_ImageSearcher_LikelyCover::test_write_album_image[happy path - case 2 - overwrite True] FAILED [ 52%]

These do not fail on my machine! :-(

_ Test_ImageSearcher_LikelyCover.test_write_album_image[happy path - case 2 - overwrite True] _
self = <coverlovin2.test.test_coverlovin2.Test_ImageSearcher_LikelyCover object at 0x7f9d745ea0b8>
image_path_src = PosixPath('/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album1.jpg')
image_path_dst = PosixPath('/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg')
image_type = <ImageType.JPG: 'jpg'>, overwrite = True
result = Result(artalb=('', ''), imagesearcher_type=<class 'coverlovin2.coverlovin2.ImageSearcher_LikelyCover'>, image_path=Pos...overlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg"', error=False, error_mesg='')
    @pytest.mark.parametrize(
        'image_path_src, image_path_dst, image_type, overwrite, ' +
        'result',
        (
            pytest.param
            (
                B3_image_path1, B3_image_path2, jpg, False,
                Result.SkipDueToNoOverwrite(ArtAlb_empty, ImageSearcher_LikelyCover, B3_image_path2, False, True),
                id='destination image already exists - overwrite False, returns False'
            ),
            pytest.param
            (
                B3_image_path1, B3_image_path2, jpg, True,
                Result.Copied(ArtAlb_empty, ImageSearcher_LikelyCover, B3_image_path1_sz, B3_image_path1, B3_image_path2, True, True),
                id='destination image already exists - overwrite True, returns True'
            ),
            pytest.param
            (
                B3_image_path1, B3_image_path_ne, jpg, False,
                Result.Copied(ArtAlb_empty, ImageSearcher_LikelyCover, 0, B3_image_path1, B3_image_path_ne, False, True),
                id='happy path - case 1 - overwrite False'
            ),
            pytest.param
            (
                B3_image_path1, B3_image_path_ne, jpg, True,
                Result.Copied(ArtAlb_empty, ImageSearcher_LikelyCover, 0, B3_image_path1, B3_image_path_ne, True, True),
                id='happy path - case 2 - overwrite True'
            )
        )
    )
    @pytest.mark.dependency(name='test_res_B3')
    def test_write_album_image(self, image_path_src, image_path_dst, image_type, overwrite, result):
        is_ = ImageSearcher_LikelyCover(ArtAlb_empty, image_path_dst, '', False)
        assert is_.search_album_image(image_type)
>       assert result == is_.write_album_image(Path(), overwrite, True)
E       assert Result(artalb...error_mesg='') == Result(artalb=...error_mesg='')
E         At index 8 diff: '(--test) ImageSearcher_LikelyCover copied 0 bytes from "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album1.jpg" to "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg"' != '(--test) ImageSearcher_LikelyCover copied 0 bytes from "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album2.jpg" to "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg"'
E         Full diff:
E         - Result(artalb=('', ''), imagesearcher_type=<class 'coverlovin2.coverlovin2.ImageSearcher_LikelyCover'>, image_path=PosixPath('/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg'), image_type=None, result_written=True, overwrite=True, test=True, result_nosuitable=False, message='(--test) ImageSearcher_LikelyCover copied 0 bytes from "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album1.jpg" to "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg"', error=False, error_mesg='')
E         ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^
E         + Result(artalb=('', ''), imagesearcher_type=<class 'coverlovin2.coverlovin2.ImageSearcher_LikelyCover'>, image_path=PosixPath('/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg'), image_type=None, result_written=True, overwrite=True, test=True, result_nosuitable=False, message='(--test) ImageSearcher_LikelyCover copied 0 bytes from "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album2.jpg" to "/home/travis/build/jtmoon79/coverlovin2/coverlovin2/test/test_resources/test_ImageSearcher_LikelyCover3/album-not-exists-file.jpg"', error=False, error_mesg='')
E         ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^
coverlovin2/test/test_coverlovin2.py:733: AssertionError
@jtmoon79 jtmoon79 self-assigned this Mar 5, 2019
@jtmoon79 jtmoon79 added bug Something isn't working good first issue Good for newcomers labels Mar 5, 2019
jtmoon79 added a commit that referenced this issue Mar 5, 2019
Hopefully fixes two failing pytests.

Issue #3

Also, fix wrong pytest.depends setting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant