Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.2:Staging:N
python-PyHamcrest
pytest4-02.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pytest4-02.patch of Package python-PyHamcrest
From 891f22d080402c8086a07e0d83f3fa27c3fa8e8f Mon Sep 17 00:00:00 2001 From: Simon Brunning <simon@brunningonline.net> Date: Fri, 2 Nov 2018 09:50:20 +0000 Subject: [PATCH 1/3] Silence warnings from tests due to use of old pytest.parameterize() signature. --- tests/hamcrest_unit_test/base_description_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/tests/hamcrest_unit_test/base_description_test.py +++ b/tests/hamcrest_unit_test/base_description_test.py @@ -34,10 +34,10 @@ def test_append_text_delegates(desc): @pytest.mark.parametrize('described, appended', ( (Described(), 'described'), - pytest.mark.skipif(six.PY3, reason="py2 only")((six.u('unicode-py2'), "'unicode-py2'")), - pytest.mark.skipif(six.PY3, reason="py2 only")((six.b('bytes-py2'), "'bytes-py2'")), - pytest.mark.skipif(six.PY2, reason="py3 only")((six.u('unicode-py3'), "'unicode-py3'")), - pytest.mark.skipif(six.PY2, reason="py3 only")((six.b('bytes-py3'), "<b'bytes-py3'>")), + pytest.param(six.u('unicode-py2'), "'unicode-py2'", marks=pytest.mark.skipif(six.PY3, reason="py2 only")), + pytest.param(six.b('bytes-py2'), "'bytes-py2'", marks=pytest.mark.skipif(six.PY3, reason="py2 only")), + pytest.param(six.u('unicode-py3'), "'unicode-py3'", marks=pytest.mark.skipif(six.PY2, reason="py3 only")), + pytest.param(six.b('bytes-py3'), "<b'bytes-py3'>", marks=pytest.mark.skipif(six.PY2, reason="py3 only")), (six.u("\U0001F4A9"), six.u("'{0}'").format(six.u("\U0001F4A9"))), )) def test_append_description_types(desc, described, appended): --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,4 @@ [pytest] addopts = --cov hamcrest --cov-report term-missing --no-cov-on-fail +markers = + issue56 --- a/tests/hamcrest_unit_test/core/is_test.py +++ b/tests/hamcrest_unit_test/core/is_test.py @@ -39,7 +39,7 @@ def test_description_should_pass_through equal_matches = pytest.mark.parametrize('arg, identity, desc', ( ('A', 'A', "'A'"), (5 + 3, 8, "<8>"), - pytest.mark.issue56((tuple(), (), "<()>")), + pytest.param(tuple(), (), "<()>", marks=pytest.mark.issue56), )) equal_mismatches = pytest.mark.parametrize('arg, identity, desc', ( @@ -65,7 +65,6 @@ def test_description_uses_equal_to(arg, @pytest.mark.parametrize('arg, identity', ( ('A', str), (1, int), - only_py2((OldClass(), OldClass)), )) def test_provides_instanceof_shortcut(arg, identity): assert_matches(is_(identity), arg, "should match") --- a/tests/hamcrest_unit_test/core/isinstanceof_test.py +++ b/tests/hamcrest_unit_test/core/isinstanceof_test.py @@ -26,7 +26,6 @@ class Child(Parent): ('foo', instance_of((str, int))), (1, instance_of((int, str))), ('foo', instance_of((int, str))), - only_py2((Parent(), instance_of(Parent))), )) def test_matching_evaluation(arg, matcher): assert_matches(matcher, arg, 'same class') @@ -35,19 +34,10 @@ def test_matching_evaluation(arg, matche @pytest.mark.parametrize('arg, matcher', ( ('hi', instance_of(int)), (None, instance_of(int)), - only_py2(('not a parent', instance_of(Parent))), - only_py2((None, instance_of(Parent))), )) def test_mismatching_evaluation(arg, matcher): assert_does_not_match(matcher, arg, 'mismatched') -@pytest.mark.parametrize('obj', ( - pytest.mark.issue56(()), - 'str', -)) -def test_matcher_creation_requires_type(obj): - with pytest.raises(TypeError): - instance_of(obj) @pytest.mark.parametrize('desc, type', ( ('an instance of int', int), --- a/tests/hamcrest_unit_test/matcher_test.py +++ b/tests/hamcrest_unit_test/matcher_test.py @@ -77,9 +77,3 @@ def assert_describe_mismatch(expected, m description = StringDescription() matcher.describe_mismatch(arg, description) assert expected == str(description) - - -only_py3 = pytest.mark.skipif(sys.version_info < (3, ), - reason="Only relevant in Python 3") -only_py2 = pytest.mark.skipif(sys.version_info >= (3, ), - reason="Only relevant in Python 2")
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor