Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 878715 - media-video/vcsi: still depends on dev-python/nose
Summary: media-video/vcsi: still depends on dev-python/nose
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Joonas Niilola
URL: https://github.com/amietn/vcsi/issues...
Whiteboard:
Keywords:
Depends on:
Blocks: 822414
  Show dependency tree
 
Reported: 2022-10-29 13:40 UTC by Michał Górny
Modified: 2022-11-10 07:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
vcsi-nose-to-pytest.patch (vcsi-nose-to-pytest.patch,10.68 KB, text/plain)
2022-11-02 06:32 UTC, Joonas Niilola
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-10-29 13:40:27 UTC
See tracker.
Comment 1 Joonas Niilola gentoo-dev 2022-10-31 07:32:21 UTC
Simply switching nose to "pytest" or "unittest" didn't work. I see a lot of 

  from nose.tools import

calls in the test files. Is this a problem that needs to be updated in upstream (which seems pretty inactive)?
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-10-31 14:05:39 UTC
Yes, it is.  They're not going to be able to use nose with py3.11, or perhaps even 3.10 because it no longer works.
Comment 3 Joonas Niilola gentoo-dev 2022-10-31 14:43:55 UTC
Upstream seems pretty dead to be honest so we may have to restrict tests for now if removing nose is a priority.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-10-31 15:46:15 UTC
(In reply to Joonas Niilola from comment #3)
> Upstream seems pretty dead to be honest so we may have to restrict tests for
> now if removing nose is a priority.

We've got other blockers right now, so no need to hurry with that.  That said, what people usually do is actually port stuff to pytest, and if upstream's not alive to merge it, fetch the patch from a fork (or put on your devspace).

https://github.com/pytest-dev/nose2pytest may be able to help.
Comment 5 Joonas Niilola gentoo-dev 2022-11-02 06:31:58 UTC
After a BATTLE to get nose2pytest to work, and manually removing those "from nose.tools import" I'm able to get ~66 % tests passing with pytest.

>>> Test phase: media-video/vcsi-7.0.13-r1
 * python3_8: running distutils-r1_run_phase python_test
python3.8 -m pytest -vv -ra -l -Wdefault --color=no -o console_output_style=count -p no:cov -p no:flake8 -p no:flakes -p no:pylint -p no:markdown -p no:sugar -p no:xvfb
======================================== test session starts ========================================
platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0 -- /usr/bin/python3.8
cachedir: .pytest_cache
rootdir: /var/tmp/portage/media-video/vcsi-7.0.13-r1/work/vcsi-264f89402c2a6d71e2db6693e802b82f5b8d3fd9
plugins: pkgcore-0.12.16, nose2pytest-1.0.8
collecting ... collected 34 items

tests/test_input.py::test_grid_default PASSED                                                [ 1/34]
tests/test_input.py::test_grid_equality PASSED                                               [ 2/34]
tests/test_input.py::test_grid_inequality PASSED                                             [ 3/34]
tests/test_input.py::test_grid_columns_integer FAILED                                        [ 4/34]
tests/test_input.py::test_grid_columns_positive FAILED                                       [ 5/34]
tests/test_input.py::test_grid_rows_integer FAILED                                           [ 6/34]
tests/test_input.py::test_grid_rows_positive FAILED                                          [ 7/34]
tests/test_input.py::test_grid_format FAILED                                                 [ 8/34]
tests/test_input.py::test_hex_color_type FAILED                                              [ 9/34]
tests/test_input.py::test_manual_timestamps FAILED                                           [10/34]
tests/test_input.py::test_timestamp_position_type FAILED                                     [11/34]
tests/test_input.py::test_interval_type PASSED                                               [12/34]
tests/test_input.py::test_comma_separated_string_type PASSED                                 [13/34]
tests/test_input.py::test_metadata_position_type FAILED                                      [14/34]
tests/test_input.py::test_cleanup PASSED                                                     [15/34]
tests/test_input.py::test_save_image PASSED                                                  [16/34]
tests/test_input.py::test_compute_timestamp_position PASSED                                  [17/34]
tests/test_input.py::test_max_line_length PASSED                                             [18/34]
tests/test_input.py::test_draw_metadata PASSED                                               [19/34]
tests/test_input.py::test_grid PASSED                                                        [20/34]
tests/test_input.py::test_color PASSED                                                       [21/34]
tests/test_mediainfo.py::test_compute_display_resolution PASSED                              [22/34]
tests/test_mediainfo.py::test_filename PASSED                                                [23/34]
tests/test_mediainfo.py::test_duration PASSED                                                [24/34]
tests/test_mediainfo.py::test_pretty_duration PASSED                                         [25/34]
tests/test_mediainfo.py::test_size_bytes PASSED                                              [26/34]
tests/test_mediainfo.py::test_size PASSED                                                    [27/34]
tests/test_mediainfo.py::test_template_attributes PASSED                                     [28/34]
tests/test_mediainfo.py::test_grid_desired_size PASSED                                       [29/34]
tests/test_mediainfo.py::test_desired_size PASSED                                            [30/34]
tests/test_mediainfo.py::test_timestamps PASSED                                              [31/34]
tests/test_mediainfo.py::test_pretty_duration_centis_limit PASSED                            [32/34]
tests/test_mediainfo.py::test_pretty_duration_millis_limit PASSED                            [33/34]
tests/test_mediainfo.py::test_pretty_to_seconds FAILED                                       [34/34]

============================================= FAILURES ==============================================
_____________________________________ test_grid_columns_integer _____________________________________

    def test_grid_columns_integer():
>       assert_raises(ArgumentTypeError, mxn_type, 'ax4')
E       NameError: name 'assert_raises' is not defined


tests/test_input.py:30: NameError
____________________________________ test_grid_columns_positive _____________________________________

    def test_grid_columns_positive():
>       assert_raises(ArgumentTypeError, mxn_type, '-1x4')
E       NameError: name 'assert_raises' is not defined


tests/test_input.py:36: NameError
______________________________________ test_grid_rows_integer _______________________________________

    def test_grid_rows_integer():
>       assert_raises(ArgumentTypeError, mxn_type, '4xa')
E       NameError: name 'assert_raises' is not defined


tests/test_input.py:40: NameError
______________________________________ test_grid_rows_positive ______________________________________

    def test_grid_rows_positive():
>       assert_raises(ArgumentTypeError, mxn_type, '4x-1')
E       NameError: name 'assert_raises' is not defined


tests/test_input.py:46: NameError
_________________________________________ test_grid_format __________________________________________

    def test_grid_format():
>       assert_raises(ArgumentTypeError, mxn_type, '')
E       NameError: name 'assert_raises' is not defined


tests/test_input.py:50: NameError
________________________________________ test_hex_color_type ________________________________________

    def test_hex_color_type():
        assert Color(*(0x10, 0x10, 0x10, 0xff)) == hex_color_type("101010")
    
        assert Color(*(0x10, 0x10, 0x10, 0x00)) == hex_color_type("10101000")
    
        assert Color(*(0xff, 0xff, 0xff, 0xff)) == hex_color_type("ffffff")
    
        assert Color(*(0xff, 0xff, 0xff, 0x00)) == hex_color_type("ffffff00")
    
>       assert_raises(ArgumentTypeError, hex_color_type, "abcdeff")
E       NameError: name 'assert_raises' is not defined


tests/test_input.py:68: NameError
______________________________________ test_manual_timestamps _______________________________________

    def test_manual_timestamps():
        assert manual_timestamps("1:11:11.111,2:22:22.222") == ["1:11:11.111", "2:22:22.222"]
    
>       assert_raises(ArgumentTypeError, manual_timestamps, "1:11:a1.111,2:22:b2.222")
E       NameError: name 'assert_raises' is not defined


tests/test_input.py:76: NameError
___________________________________ test_timestamp_position_type ____________________________________

    def test_timestamp_position_type():
        assert timestamp_position_type("north") == TimestampPosition.north
    
        assert timestamp_position_type("south") != TimestampPosition.north
    
>       assert_raises(ArgumentTypeError, timestamp_position_type, "whatever")
E       NameError: name 'assert_raises' is not defined


tests/test_input.py:88: NameError
____________________________________ test_metadata_position_type ____________________________________

    def test_metadata_position_type():
        assert metadata_position_type("top") == "top"
    
        assert metadata_position_type("TOP") == "top"
    
>       assert_raises(ArgumentTypeError, metadata_position_type, "whatever")
E       NameError: name 'assert_raises' is not defined


tests/test_input.py:110: NameError
______________________________________ test_pretty_to_seconds _______________________________________

    def test_pretty_to_seconds():
        assert MediaInfo.pretty_to_seconds("1:11:11.111") == 4271.111
    
        assert MediaInfo.pretty_to_seconds("1:11:11") == 4271
    
        assert MediaInfo.pretty_to_seconds("1:01:00") == 3660
    
>       assert_raises(ArgumentTypeError, MediaInfo.pretty_to_seconds, "1:01:01:01:00")
E       NameError: name 'assert_raises' is not defined


tests/test_mediainfo.py:121: NameError
====================================== short test summary info ======================================
FAILED tests/test_input.py::test_grid_columns_integer - NameError: name 'assert_raises' is not def...
FAILED tests/test_input.py::test_grid_columns_positive - NameError: name 'assert_raises' is not de...
FAILED tests/test_input.py::test_grid_rows_integer - NameError: name 'assert_raises' is not defined
FAILED tests/test_input.py::test_grid_rows_positive - NameError: name 'assert_raises' is not defined
FAILED tests/test_input.py::test_grid_format - NameError: name 'assert_raises' is not defined
FAILED tests/test_input.py::test_hex_color_type - NameError: name 'assert_raises' is not defined
FAILED tests/test_input.py::test_manual_timestamps - NameError: name 'assert_raises' is not defined
FAILED tests/test_input.py::test_timestamp_position_type - NameError: name 'assert_raises' is not ...
FAILED tests/test_input.py::test_metadata_position_type - NameError: name 'assert_raises' is not d...
FAILED tests/test_mediainfo.py::test_pretty_to_seconds - NameError: name 'assert_raises' is not de...
=================================== 10 failed, 24 passed in 0.23s ===================================
 * ERROR: media-video/vcsi-7.0.13-r1::gentoo failed (test phase):
 *   pytest failed with python3.8
Comment 6 Joonas Niilola gentoo-dev 2022-11-02 06:32:30 UTC
Created attachment 826597 [details]
vcsi-nose-to-pytest.patch
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-11-02 06:55:54 UTC
You're looking for pytest.raises().
Comment 8 Larry the Git Cow gentoo-dev 2022-11-03 08:08:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9043aa0f764ea20a1f64f3cb286e2c6b55f95ede

commit 9043aa0f764ea20a1f64f3cb286e2c6b55f95ede
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2022-11-03 06:37:47 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-11-03 08:07:58 +0000

    media-video/vcsi: bump snapshot commit, migrates from nose to pytest
    
    Closes: https://bugs.gentoo.org/878715
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 media-video/vcsi/Manifest              |  1 +
 media-video/vcsi/vcsi-7.0.13-r1.ebuild | 30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
Comment 9 Larry the Git Cow gentoo-dev 2022-11-10 07:54:57 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b02ff28fa31797078fc721f69a831760f11a8a9a

commit b02ff28fa31797078fc721f69a831760f11a8a9a
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2022-11-10 07:17:49 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-11-10 07:54:52 +0000

    media-video/vcsi: drop 7.0.13
    
    Bug: https://bugs.gentoo.org/878715
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 media-video/vcsi/Manifest           |  1 -
 media-video/vcsi/vcsi-7.0.13.ebuild | 30 ------------------------------
 2 files changed, 31 deletions(-)