From 791499873977840329b2278dd502a8b92806f37a313378ae1644aec5305eed3d Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 16 Feb 2022 16:34:59 +0000 Subject: [PATCH 1/2] Accepting request 955343 from openSUSE:infrastructure:mailman3 - Fix issue with tests failing on different filesystem setups OBS-URL: https://build.opensuse.org/request/show/955343 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sybil?expand=0&rev=26 --- python-sybil-fix-ordering.diff | 26 ++++++++++++++++++++++++++ python-sybil.changes | 5 +++++ python-sybil.spec | 2 ++ 3 files changed, 33 insertions(+) create mode 100644 python-sybil-fix-ordering.diff diff --git a/python-sybil-fix-ordering.diff b/python-sybil-fix-ordering.diff new file mode 100644 index 0000000..a0fd1c9 --- /dev/null +++ b/python-sybil-fix-ordering.diff @@ -0,0 +1,26 @@ +diff --git a/sybil/integration/unittest.py b/sybil/integration/unittest.py +index 7129ddf..ce34caf 100644 +--- a/sybil/integration/unittest.py ++++ b/sybil/integration/unittest.py +@@ -38,7 +38,7 @@ def unittest_integration(sybil: 'Sybil'): + + def load_tests(loader=None, tests=None, pattern=None): + suite = TestSuite() +- for path in sybil.path.glob('**/*'): ++ for path in sorted(sybil.path.glob('**/*')): + if path.is_file() and sybil.should_parse(path): + document = sybil.parse(path) + +diff --git a/tests/test_sybil.py b/tests/test_sybil.py +index 74a04ea..72a5aea 100644 +--- a/tests/test_sybil.py ++++ b/tests/test_sybil.py +@@ -243,7 +243,7 @@ def parse(document): + + def test_namespace(capsys): + sybil = Sybil([parse], path='./samples') +- documents = [sybil.parse(p) for p in sybil.path.glob('sample*.txt')] ++ documents = [sybil.parse(p) for p in sorted(sybil.path.glob('sample*.txt'))] + actual = [] + for document in documents: + for example in document: diff --git a/python-sybil.changes b/python-sybil.changes index 94346a7..4bb6138 100644 --- a/python-sybil.changes +++ b/python-sybil.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 16 11:44:28 UTC 2022 - Sasi Olin + +- Fix issue with tests failing on different filesystem setups + ------------------------------------------------------------------- Mon Dec 13 04:11:03 UTC 2021 - Steve Kowalik diff --git a/python-sybil.spec b/python-sybil.spec index 5cd72f7..b9a9c81 100644 --- a/python-sybil.spec +++ b/python-sybil.spec @@ -25,6 +25,7 @@ Summary: Automated testing of examples in documentation License: MIT URL: https://github.com/cjw296/sybil Source: https://files.pythonhosted.org/packages/source/s/sybil/sybil-%{version}.tar.gz +Patch0: python-sybil-fix-ordering.diff BuildRequires: %{python_module pytest >= 6.2} BuildRequires: %{python_module setuptools-git} BuildRequires: %{python_module setuptools} @@ -42,6 +43,7 @@ of the normal test run. Integration is provided for the main Python test runners %prep %setup -q -n sybil-%{version} sed -i '/pytest-cov/ d' setup.py +%patch0 -p1 %build %python_build From fbd8547bbc15970d3ed183d84c6527707bf605e743b7adf960fc3672bcb8cca8 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 16 Feb 2022 16:50:15 +0000 Subject: [PATCH 2/2] Fixing changelog OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sybil?expand=0&rev=27 --- python-sybil.changes | 3 ++- python-sybil.spec | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/python-sybil.changes b/python-sybil.changes index 4bb6138..e14a4fc 100644 --- a/python-sybil.changes +++ b/python-sybil.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- Wed Feb 16 11:44:28 UTC 2022 - Sasi Olin -- Fix issue with tests failing on different filesystem setups +- Add python-sybil-fix-ordering.diff fixing issue with tests + failing on different filesystem setups. ------------------------------------------------------------------- Mon Dec 13 04:11:03 UTC 2021 - Steve Kowalik diff --git a/python-sybil.spec b/python-sybil.spec index b9a9c81..421500a 100644 --- a/python-sybil.spec +++ b/python-sybil.spec @@ -1,7 +1,7 @@ # # spec file for package python-sybil # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,9 +26,11 @@ License: MIT URL: https://github.com/cjw296/sybil Source: https://files.pythonhosted.org/packages/source/s/sybil/sybil-%{version}.tar.gz Patch0: python-sybil-fix-ordering.diff +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest >= 6.2} BuildRequires: %{python_module setuptools-git} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Recommends: python-pytest @@ -43,13 +45,13 @@ of the normal test run. Integration is provided for the main Python test runners %prep %setup -q -n sybil-%{version} sed -i '/pytest-cov/ d' setup.py -%patch0 -p1 +%autopatch -p1 %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check