Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 797307 - dev-python/agate: missing tests, also old version
Summary: dev-python/agate: missing tests, also old version
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Zac Medico
URL:
Whiteboard:
Keywords:
: 797316 (view as bug list)
Depends on:
Blocks: 784263
  Show dependency tree
 
Reported: 2021-06-21 08:45 UTC by Michał Górny
Modified: 2021-06-21 23:32 UTC (History)
1 user (show)

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


Attachments

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 2021-06-21 08:45:44 UTC
Upstream repo definitely has tests.

Also, pypi mentions 1.6.2 release while you added 1.6.1 from 2018.
Comment 1 Agostino Sarubbo gentoo-dev 2021-06-21 09:18:50 UTC
*** Bug 797316 has been marked as a duplicate of this bug. ***
Comment 2 Larry the Git Cow gentoo-dev 2021-06-21 19:38:24 UTC
The bug has been closed via the following commit(s):

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

commit 47e3901d7d0c2c6af500ac7855ec2d4855249380
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-21 19:27:41 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-21 19:37:21 +0000

    dev-python/agate: Bump to version 1.6.2 + enable tests
    
    Closes: https://bugs.gentoo.org/797307
    Reported-by: Michał Górny <mgorny@gentoo.org>
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 dev-python/agate/Manifest                            |  2 +-
 .../agate/{agate-1.6.1.ebuild => agate-1.6.2.ebuild} | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
Comment 3 Zac Medico gentoo-dev 2021-06-21 19:43:24 UTC
Thanks!

I'll have to report the tag missing in https://github.com/wireservice/agate/tags.

All of the unit tests passed for me aside from these two xfails:

> +BDEPEND="
> +	test? (
> +		dev-python/pytest-expect[${PYTHON_USEDEP}]
> +	)
> +"
> +
> +distutils_enable_tests pytest
> +
> +python_prepare_all() {
> +	cat > .pytest.expect <<-EOF
> +pytest-expect file v1
> +(3, 8, 10, 'final', 0)
> +u'tests/test_data_types.py::TestDate::test_cast_format_locale': FAIL
> +u'tests/test_data_types.py::TestDateTime::test_cast_format_locale': FAIL
> +EOF
> +	distutils-r1_python_prepare_all
> +}
Comment 4 Larry the Git Cow gentoo-dev 2021-06-21 21:19:24 UTC
The bug has been referenced in the following commit(s):

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

commit 1ded69a8ae9c41da9bf7da03b65fdb2ec38a9376
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-21 21:06:56 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-21 21:19:20 +0000

    dev-python/agate: Replace pytest-expect with pure bash
    
    Replace pytest-expect with pure bash in order to use
    the preferred skipping-tests-based-on-paths-names recipe
    via epytest --deselect arguments, and also add the missing
    epytest die call reported by David Seifert.
    
    The included pytest-expect-to-deselect function can
    perhaps be migrated to an eclass somewhere:
    
    # @FUNCTION: pytest-expect-to-deselect
    # @USAGE: readarray -t pytest_args < <(pytest-expect-to-deselect <<<PYTEST_EXPECT_CONTENT)
    # @DESCRIPTION:
    # Read a pytest-expect pytest --xfail-file file from stdin and write
    # equivalent pytest --deselect arguments to stdout for consumption by
    # readarray -t. The generated pytest --deselect arguments are appropriate
    # for use as described here:
    # https://dev.gentoo.org/~mgorny/python-guide/pytest.html#skipping-tests-based-on-paths-names
    pytest-expect-to-deselect() {
            while read -r; do
                    [[ ${REPLY} =~ ^[u]?\'([^\']*) ]] || continue
                    printf -- '%s\n' --deselect "${BASH_REMATCH[1]}" || return
            done
    }
    
    See: https://dev.gentoo.org/~mgorny/python-guide/pytest.html#skipping-tests-based-on-paths-names
    Bug: https://bugs.gentoo.org/797307
    Reported-by: Michał Górny <mgorny@gentoo.org>
    Reported-by: David Seifert <soap@gentoo.org>
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 dev-python/agate/agate-1.6.2.ebuild | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)
Comment 5 Larry the Git Cow gentoo-dev 2021-06-21 23:32:48 UTC
The bug has been referenced in the following commit(s):

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

commit 11c0d4017460fbdecea2209280d790310db6e98a
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-21 23:23:54 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-21 23:32:43 +0000

    dev-python/agate: Comment on details of xfails skipped via epytest --deselect
    
    test_cast_format_locale fails with "locale.Error: unsupported locale setting"
    which appears to be triggered by these locale settings in the unit tests:
    
      agate-1.6.2/tests/test_data_types.py:257:    def test_cast_format_locale(self):
      agate-1.6.2/tests/test_data_types.py-258-        date_type = Date(date_format='%d-%b-%Y', locale='de_DE')
      agate-1.6.2/tests/test_data_types.py:381:    def test_cast_format_locale(self):
      agate-1.6.2/tests/test_data_types.py-382-        date_type = DateTime(datetime_format='%Y-%m-%d %I:%M %p', locale='ko_KR')
    
    Bug: https://bugs.gentoo.org/797307
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 dev-python/agate/agate-1.6.2.ebuild | 8 ++++++++
 1 file changed, 8 insertions(+)