Accepting request 865545 from home:jayvdb:branches:devel:languages:python:pytest

- Fix incompatibility with pytest 6.2.1
- Disable Python 2 builds due to pytest minimum version
- Re-enable two disabled tests
- Update to v3.0.0
  * refactor for pytest 6 compatibility

OBS-URL: https://build.opensuse.org/request/show/865545
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-translations?expand=0&rev=11
This commit is contained in:
Matej Cepl 2021-01-22 07:20:39 +00:00 committed by Git OBS Bridge
parent c8402df2cb
commit 447539c4dc
5 changed files with 199 additions and 10 deletions

176
pr_48.patch Normal file
View File

@ -0,0 +1,176 @@
From cf4626a8bbbb5a3677094e71dbbe8fd1f9003282 Mon Sep 17 00:00:00 2001
From: John Vandenberg <jayvdb@gmail.com>
Date: Fri, 22 Jan 2021 12:28:14 +0800
Subject: [PATCH] test_translations.py: Add . to ext
Fixes https://github.com/Thermondo/pytest-translations/issues/47
---
test_translations.py | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/test_translations.py b/test_translations.py
index 2416319..ddfff34 100644
--- a/test_translations.py
+++ b/test_translations.py
@@ -12,7 +12,7 @@ class TestMo(object):
@pytest.fixture
def pomo(self, testdir):
pofile = testdir.makefile(
- 'po',
+ '.po',
"""
#: asdf.py:111
msgid "car"
@@ -29,7 +29,7 @@ def pomo(self, testdir):
def test_broken_file(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
#: asdf.py:111
msgid "car"
@@ -37,7 +37,7 @@ def test_broken_file(self, testdir):
"""
)
testdir.makefile(
- 'mo',
+ '.mo',
"""
asdflkaj sdlkfaj
""",
@@ -76,7 +76,7 @@ def test_entry_mismatch(self, testdir, pomo):
os.unlink(po)
testdir.makefile(
- 'po',
+ '.po',
"""
msgid ""
msgstr ""
@@ -100,7 +100,7 @@ def test_entry_mismatch(self, testdir, pomo):
class TestPo(object):
def test_uses_argument(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
#: asdf.py:111
msgid "car"
@@ -114,7 +114,7 @@ def test_uses_argument(self, testdir):
def test_broken_file(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
asdflkaj sdlkfaj
"""
@@ -127,7 +127,7 @@ def test_broken_file(self, testdir):
def test_valid(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
#: asdf.py:111
msgid "car"
@@ -143,7 +143,7 @@ def test_valid(self, testdir):
def test_missing_translation(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
#: asdf.py:111
msgid "car"
@@ -159,7 +159,7 @@ def test_missing_translation(self, testdir):
def test_fuzzy(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
#: asdf.py:111
#, fuzzy
@@ -177,7 +177,7 @@ def test_fuzzy(self, testdir):
def test_obsolete(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
#: asdf.py:111
#~ msgid "car"
@@ -194,7 +194,7 @@ def test_obsolete(self, testdir):
def test_all(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
#: asdf.py:111
msgid "car2"
@@ -224,7 +224,7 @@ def test_all(self, testdir):
class TestPoSpellcheck(object):
def test_broken_file(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
asdflkjasdf laskdjfasdf
"""
@@ -236,7 +236,7 @@ def test_broken_file(self, testdir):
def test_language_missing_in_po(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
#: asdf.py:111
msgid "meeting"
@@ -251,7 +251,7 @@ def test_language_missing_in_po(self, testdir):
def test_language_catalog_missing(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
msgid ""
msgstr ""
@@ -270,7 +270,7 @@ def test_language_catalog_missing(self, testdir):
def test_python_format_placeholders(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
msgid ""
msgstr ""
@@ -289,7 +289,7 @@ def test_python_format_placeholders(self, testdir):
def test_pass(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
msgid ""
msgstr ""
@@ -308,7 +308,7 @@ def test_pass(self, testdir):
def test_fail(self, testdir):
testdir.makefile(
- 'po',
+ '.po',
"""
msgid ""
msgstr ""
@@ -329,7 +329,7 @@ def test_fail(self, testdir):
def test_wordlist(self, testdir, monkeypatch):
testdir.makefile(
- 'po',
+ '.po',
"""
msgid ""
msgstr ""

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8f5aa5e98746ccc5e400486ea2084fd71251ccb35c0c53e4e1026d8af380bc08
size 8467

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1072a26e29aa8387d3ecd30ff98b1dcc11b7ff97376eebd2d318212e0bef142c
size 8422

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Jan 22 04:30:02 UTC 2021 - John Vandenberg <jayvdb@gmail.com>
- Fix incompatibility with pytest 6.2.1
- Disable Python 2 builds due to pytest minimum version
- Re-enable two disabled tests
- Update to v3.0.0
* refactor for pytest 6 compatibility
-------------------------------------------------------------------
Sat Mar 14 08:48:48 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-pytest-translations
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,17 +17,16 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-pytest-translations
Version: 2.0.0
Version: 3.0.0
Release: 0
Summary: Plugin for testing gettext, .po and .mo files
License: Apache-2.0
URL: https://github.com/Thermondo/pytest-translations
Source: https://files.pythonhosted.org/packages/source/p/pytest-translations/pytest-translations-%{version}.tar.gz
Patch0: https://patch-diff.githubusercontent.com/raw/Thermondo/pytest-translations/pull/48.patch#/pr_48.patch
BuildRequires: %{python_module pbr}
BuildRequires: %{python_module polib >= 1.0.5}
BuildRequires: %{python_module pyenchant >= 1.6.0}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: myspell-de_DE
@ -35,6 +34,11 @@ BuildRequires: python-rpm-macros
Requires: python-polib >= 1.0.5
Requires: python-pyenchant >= 1.6.0
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module polib >= 1.0.5}
BuildRequires: %{python_module pyenchant >= 1.6.0}
BuildRequires: %{python_module pytest > 5}
# /SECTION
%python_subpackages
%description
@ -47,6 +51,7 @@ Test check for:
%prep
%setup -q -n pytest-translations-%{version}
%patch0 -p1
%build
export LANG=en_US.UTF-8
@ -59,8 +64,7 @@ export LANG=en_US.UTF-8
%check
export LANG=en_US.UTF-8
# skipped tests needs language dicts
%pytest -k 'not (test_language_missing_in_po or test_language_catalog_missing)'
%pytest
%files %{python_files}
%doc AUTHORS ChangeLog README.rst