forked from pool/python-podcastparser
- version update to 0.6.5 * no upstream changelog - added patches fix https://github.com/gpodder/podcastparser/pull/21 + python-podcastparser-remove-nose.patch OBS-URL: https://build.opensuse.org/request/show/821139 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-podcastparser?expand=0&rev=9
129 lines
5.0 KiB
Diff
129 lines
5.0 KiB
Diff
Index: podcastparser-0.6.5/test_podcastparser.py
|
|
===================================================================
|
|
--- podcastparser-0.6.5.orig/test_podcastparser.py 2020-04-07 22:00:53.000000000 +0200
|
|
+++ podcastparser-0.6.5/test_podcastparser.py 2020-07-15 16:18:39.885076713 +0200
|
|
@@ -29,14 +29,14 @@ except ImportError:
|
|
from io import StringIO
|
|
|
|
|
|
-from nose.tools import assert_equal
|
|
-from nose.tools import assert_raises
|
|
-
|
|
+import pytest
|
|
import podcastparser
|
|
|
|
|
|
-def test_rss_parsing():
|
|
- def test_parse_rss(rss_filename):
|
|
+class TestPodcastparser:
|
|
+ # test RSS parsing
|
|
+ @pytest.mark.parametrize("rss_filename", glob.glob(os.path.join('tests', 'data', '*.rss')))
|
|
+ def test_parse_rss(self, rss_filename):
|
|
basename, _ = os.path.splitext(rss_filename)
|
|
json_filename = basename + '.json'
|
|
|
|
@@ -53,21 +53,16 @@ def test_rss_parsing():
|
|
parsed = podcastparser.parse('file://' + normalized_rss_filename,
|
|
open(rss_filename), **params)
|
|
|
|
- assert_equal.__self__.maxDiff = None
|
|
- assert_equal(expected, parsed)
|
|
-
|
|
- for rss_filename in glob.glob(os.path.join('tests', 'data', '*.rss')):
|
|
- yield test_parse_rss, rss_filename
|
|
-
|
|
-def test_invalid_roots():
|
|
- def test_fail_parse(feed):
|
|
- with assert_raises(podcastparser.FeedParseError):
|
|
- podcastparser.parse('file://example.com/feed.xml', StringIO(feed))
|
|
+ assert expected == parsed
|
|
|
|
+ # test invalid roots
|
|
feeds = [
|
|
'<html><body/></html>',
|
|
'<foo xmlns="http://example.com/foo.xml"><bar/></foo>',
|
|
'<baz:foo xmlns:baz="http://example.com/baz.xml"><baz:bar/></baz:foo>',
|
|
]
|
|
- for feed in feeds:
|
|
- yield test_fail_parse, feed
|
|
+ @pytest.mark.parametrize("feed", feeds)
|
|
+ def test_fail_parse(self, feed):
|
|
+ with pytest.raises(podcastparser.FeedParseError):
|
|
+ podcastparser.parse('file://example.com/feed.xml', StringIO(feed))
|
|
+
|
|
Index: podcastparser-0.6.5/README.md
|
|
===================================================================
|
|
--- podcastparser-0.6.5.orig/README.md 2017-10-30 13:12:24.000000000 +0100
|
|
+++ podcastparser-0.6.5/README.md 2020-07-15 16:18:39.885076713 +0200
|
|
@@ -7,4 +7,4 @@ easy and reliable way of parsing RSS- an
|
|
|
|
## Automated Tests
|
|
|
|
-To run the unit tests you need [`nose`](http://nose.readthedocs.io/en/latest/). If you have `nose` installed, use the `nosetests` command in the repository's root directory to run the tests.
|
|
+To run the unit tests you need [`pytest`](https://docs.pytest.org/). If you have `pytest` installed, use the `pytest` command in the repository's root directory to run the tests.
|
|
Index: podcastparser-0.6.5/makefile
|
|
===================================================================
|
|
--- podcastparser-0.6.5.orig/makefile 2017-10-30 13:12:24.000000000 +0100
|
|
+++ podcastparser-0.6.5/makefile 2020-07-15 16:19:05.461229009 +0200
|
|
@@ -2,7 +2,7 @@ PACKAGE := podcastparser
|
|
|
|
PYTHON ?= python
|
|
FIND ?= find
|
|
-NOSETESTS ?= $(PYTHON) -m nose
|
|
+PYTEST ?= $(PYTHON) -m pytest
|
|
|
|
help:
|
|
@echo ""
|
|
@@ -12,7 +12,7 @@ help:
|
|
@echo ""
|
|
|
|
test:
|
|
- $(NOSETESTS)
|
|
+ $(PYTEST)
|
|
|
|
clean:
|
|
$(FIND) . -name '*.pyc' -o -name __pycache__ -exec $(RM) -r '{}' +
|
|
Index: podcastparser-0.6.5/requirements-test.txt
|
|
===================================================================
|
|
--- podcastparser-0.6.5.orig/requirements-test.txt 2017-10-30 13:12:24.000000000 +0100
|
|
+++ podcastparser-0.6.5/requirements-test.txt 2020-07-15 16:19:27.093357818 +0200
|
|
@@ -1,2 +1,3 @@
|
|
-nose
|
|
+pytest
|
|
+pytest-cov
|
|
coverage
|
|
Index: podcastparser-0.6.5/PKG-INFO
|
|
===================================================================
|
|
--- podcastparser-0.6.5.orig/PKG-INFO 2020-04-07 22:02:14.000000000 +0200
|
|
+++ podcastparser-0.6.5/PKG-INFO 2020-07-15 16:20:37.889779388 +0200
|
|
@@ -15,6 +15,6 @@ Description: podcastparser: Simple, fast
|
|
|
|
## Automated Tests
|
|
|
|
- To run the unit tests you need [`nose`](http://nose.readthedocs.io/en/latest/). If you have `nose` installed, use the `nosetests` command in the repository's root directory to run the tests.
|
|
+ To run the unit tests you need [`pytest`](http://docs.pytest.org/). If you have `pytest` installed, use the `pytest` command in the repository's root directory to run the tests.
|
|
|
|
Platform: UNKNOWN
|
|
Index: podcastparser-0.6.5/pytest.ini
|
|
===================================================================
|
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
+++ podcastparser-0.6.5/pytest.ini 2020-07-15 16:22:39.186501697 +0200
|
|
@@ -0,0 +1,3 @@
|
|
+[pytest]
|
|
+addopts = --cov=podcastparser --cov-report html --doctest-modules
|
|
+
|
|
Index: podcastparser-0.6.5/setup.cfg
|
|
===================================================================
|
|
--- podcastparser-0.6.5.orig/setup.cfg 2017-10-30 13:12:24.000000000 +0100
|
|
+++ podcastparser-0.6.5/setup.cfg 2020-07-15 16:21:02.817927825 +0200
|
|
@@ -1,9 +1,3 @@
|
|
-[nosetests]
|
|
-cover-erase = true
|
|
-with-coverage = true
|
|
-cover-package = podcastparser
|
|
-with-doctest = true
|
|
-
|
|
[pep8]
|
|
max-line-length = 120
|
|
exclude = doc/conf.py
|