From a70f47d1f89e98a62ea47a2826eb7d3e5eaac629 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: May 06 2020 07:12:57 +0000 Subject: [PATCH 1/4] TST: Remove unused imports. Especially `mock` is useless since it's in the standard library now, so one less dep. --- diff --git a/tests/test_mdapi_data.py b/tests/test_mdapi_data.py index 544fef9..6521876 100644 --- a/tests/test_mdapi_data.py +++ b/tests/test_mdapi_data.py @@ -32,9 +32,7 @@ import subprocess import sys import tempfile -import mock import pytest -from aiohttp import web sys.path.insert(0, os.path.join(os.path.dirname( os.path.abspath(__file__)), '..')) diff --git a/tests/test_mdapi_empty.py b/tests/test_mdapi_empty.py index 7c3de02..5c02e02 100644 --- a/tests/test_mdapi_empty.py +++ b/tests/test_mdapi_empty.py @@ -26,13 +26,9 @@ Tests for mdapi. ''' import os -import shutil -import subprocess import sys -import tempfile import pytest -from aiohttp import web sys.path.insert(0, os.path.join(os.path.dirname( os.path.abspath(__file__)), '..')) diff --git a/tox.ini b/tox.ini index 821a3c0..d5f74b4 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,6 @@ deps = pytest pytest-cov pytest-aiohttp - mock setenv = PYTHONPATH={toxinidir} commands = From f73658dd28bf263dafe2d030cba586183c5215fe Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: May 06 2020 07:12:57 +0000 Subject: [PATCH 2/4] TST: Replace deprecated pytest-aiohttp fixtures. These cause a whole bunch of warnings. --- diff --git a/tests/test_mdapi_data.py b/tests/test_mdapi_data.py index 6521876..2fb1814 100644 --- a/tests/test_mdapi_data.py +++ b/tests/test_mdapi_data.py @@ -78,10 +78,10 @@ def tmpdir(): @pytest.fixture -async def cli(set_env, tmpdir, loop, test_client): +async def cli(set_env, tmpdir, aiohttp_client): mdapi.CONFIG['DB_FOLDER'] = tmpdir app = await init_app() - return await test_client(app) + return await aiohttp_client(app) diff --git a/tests/test_mdapi_empty.py b/tests/test_mdapi_empty.py index 5c02e02..e1bbcdf 100644 --- a/tests/test_mdapi_empty.py +++ b/tests/test_mdapi_empty.py @@ -40,10 +40,10 @@ HERE = os.path.join(os.path.dirname(os.path.abspath(__file__))) @pytest.fixture -async def cli(loop, test_client): +async def cli(aiohttp_client): mdapi.CONFIG['DB_FOLDER'] = '.' app = await init_app() - return await test_client(app) + return await aiohttp_client(app) async def test_view_index_page(cli): From 68e2cdf9c013b20166cf91f1a000e95305ce78a4 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: May 06 2020 07:12:57 +0000 Subject: [PATCH 3/4] DOC/TST: Use a Perl package that still exists. It seems that perl(SetupLog) is not provided by anything any more. --- diff --git a/mdapi/index.html b/mdapi/index.html index 44f0f0a..af0f717 100644 --- a/mdapi/index.html +++ b/mdapi/index.html @@ -146,8 +146,8 @@ Few examples: /rawhide/requires/R To see what R itself requires, check its information using: /rawhide/pkg/R - packages providing perl(SetupLog) in rawhide: - /rawhide/provides/perl(SetupLog) + packages providing perl(CGI) in rawhide: + /rawhide/provides/perl(CGI) packages obsoleting cabal2spec in rawhide: rawhide/obsoletes/cabal2spec diff --git a/tests/test_mdapi_data.py b/tests/test_mdapi_data.py index 2fb1814..792d14d 100644 --- a/tests/test_mdapi_data.py +++ b/tests/test_mdapi_data.py @@ -142,7 +142,7 @@ async def test_view_changelog_rawhide(cli): @pytest.mark.parametrize("action, package, status_code", [ ("requires", "R", 200), - ("provides", "perl(SetupLog)", 200), + ("provides", "perl(CGI)", 200), ("provides", "R", 200), ("obsoletes", "cabal2spec", 200), ("conflicts", "mariadb", 200), From 6d7179986eb0f37c625c162a26c66455e093eb82 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: May 06 2020 07:12:57 +0000 Subject: [PATCH 4/4] DOC: Fix a typo in a link. --- diff --git a/mdapi/index.html b/mdapi/index.html index af0f717..782d82e 100644 --- a/mdapi/index.html +++ b/mdapi/index.html @@ -144,7 +144,7 @@ Few examples: packages requiring R in rawhide: /rawhide/requires/R - To see what R itself requires, check its information using: /rawhide/pkg/R + To see what R itself requires, check its information using: /rawhide/pkg/R packages providing perl(CGI) in rawhide: /rawhide/provides/perl(CGI)