From 447539c4dc116c399b0fb0b4c4e464fb5638c0055c992842583769e289f7166b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 22 Jan 2021 07:20:39 +0000 Subject: [PATCH] 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 --- pr_48.patch | 176 +++++++++++++++++++++++++++++ pytest-translations-2.0.0.tar.gz | 3 - pytest-translations-3.0.0.tar.gz | 3 + python-pytest-translations.changes | 9 ++ python-pytest-translations.spec | 18 +-- 5 files changed, 199 insertions(+), 10 deletions(-) create mode 100644 pr_48.patch delete mode 100644 pytest-translations-2.0.0.tar.gz create mode 100644 pytest-translations-3.0.0.tar.gz diff --git a/pr_48.patch b/pr_48.patch new file mode 100644 index 0000000..71049a0 --- /dev/null +++ b/pr_48.patch @@ -0,0 +1,176 @@ +From cf4626a8bbbb5a3677094e71dbbe8fd1f9003282 Mon Sep 17 00:00:00 2001 +From: John Vandenberg +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 "" diff --git a/pytest-translations-2.0.0.tar.gz b/pytest-translations-2.0.0.tar.gz deleted file mode 100644 index d676074..0000000 --- a/pytest-translations-2.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8f5aa5e98746ccc5e400486ea2084fd71251ccb35c0c53e4e1026d8af380bc08 -size 8467 diff --git a/pytest-translations-3.0.0.tar.gz b/pytest-translations-3.0.0.tar.gz new file mode 100644 index 0000000..9ce24e2 --- /dev/null +++ b/pytest-translations-3.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1072a26e29aa8387d3ecd30ff98b1dcc11b7ff97376eebd2d318212e0bef142c +size 8422 diff --git a/python-pytest-translations.changes b/python-pytest-translations.changes index 9e53a1c..24b7c12 100644 --- a/python-pytest-translations.changes +++ b/python-pytest-translations.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Jan 22 04:30:02 UTC 2021 - John Vandenberg + +- 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 diff --git a/python-pytest-translations.spec b/python-pytest-translations.spec index 819fd4a..a35b240 100644 --- a/python-pytest-translations.spec +++ b/python-pytest-translations.spec @@ -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