From af6222e06c5f9b558ac391254844db6b28f4111f Mon Sep 17 00:00:00 2001 From: OMEGARAZER <869111+OMEGARAZER@users.noreply.github.com> Date: Sat, 17 Dec 2022 20:35:58 -0500 Subject: [PATCH] Cleanup tests Cleans up test args on new tests. Add log path to default config test so as not to mangle default log outside of tests. Match setup functions to archive/clone. Remove testing marker that was commited in error. --- pyproject.toml | 1 - .../test_archive_integration.py | 10 ++-------- .../integration_tests/test_clone_integration.py | 10 ++-------- .../test_download_integration.py | 16 +++++----------- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 23ae690b..6879a6d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,5 +78,4 @@ markers = [ "reddit: tests require a connection to Reddit", "slow: test is slow to run", "authenticated: test requires an authenticated Reddit instance", - "testing: incomplete tests", ] diff --git a/tests/integration_tests/test_archive_integration.py b/tests/integration_tests/test_archive_integration.py index 1c0d30ac..c5ad9fbd 100644 --- a/tests/integration_tests/test_archive_integration.py +++ b/tests/integration_tests/test_archive_integration.py @@ -184,14 +184,8 @@ def test_cli_archive_soft_fail(test_args: list[str], tmp_path: Path): @pytest.mark.parametrize( ("test_args", "response"), ( - ( - ["--user", "nasa", "--submitted"], - 502, - ), - ( - ["--user", "nasa", "--submitted"], - 504, - ), + (["--user", "nasa", "--submitted"], 502), + (["--user", "nasa", "--submitted"], 504), ), ) def test_user_serv_fail(test_args: list[str], response: int, tmp_path: Path): diff --git a/tests/integration_tests/test_clone_integration.py b/tests/integration_tests/test_clone_integration.py index eb643647..cba41022 100644 --- a/tests/integration_tests/test_clone_integration.py +++ b/tests/integration_tests/test_clone_integration.py @@ -76,14 +76,8 @@ def test_cli_scrape_soft_fail(test_args: list[str], tmp_path: Path): @pytest.mark.parametrize( ("test_args", "response"), ( - ( - ["--user", "nasa", "--submitted"], - 502, - ), - ( - ["--user", "nasa", "--submitted"], - 504, - ), + (["--user", "nasa", "--submitted"], 502), + (["--user", "nasa", "--submitted"], 504), ), ) def test_user_serv_fail(test_args: list[str], response: int, tmp_path: Path): diff --git a/tests/integration_tests/test_download_integration.py b/tests/integration_tests/test_download_integration.py index e44c95e4..287e8d46 100644 --- a/tests/integration_tests/test_download_integration.py +++ b/tests/integration_tests/test_download_integration.py @@ -15,7 +15,7 @@ def copy_test_config(run_path: Path): - shutil.copy(Path("./tests/test_config.cfg"), Path(run_path, "./test_config.cfg")) + shutil.copy(Path("./tests/test_config.cfg"), Path(run_path, "test_config.cfg")) def create_basic_args_for_download_runner(test_args: list[str], run_path: Path): @@ -25,7 +25,7 @@ def create_basic_args_for_download_runner(test_args: list[str], run_path: Path): str(run_path), "-v", "--config", - str(Path(run_path, "./test_config.cfg")), + str(Path(run_path, "test_config.cfg")), "--log", str(Path(run_path, "test_log.txt")), ] + test_args @@ -279,7 +279,7 @@ def test_cli_download_hard_fail(test_args: list[str], tmp_path: Path): def test_cli_download_use_default_config(tmp_path: Path): runner = CliRunner() - test_args = ["download", "-vv", str(tmp_path)] + test_args = ["download", "-vv", str(tmp_path), "--log", str(Path(tmp_path, "test_log.txt"))] result = runner.invoke(cli, test_args) assert result.exit_code == 0 @@ -404,14 +404,8 @@ def test_cli_download_score_filter(test_args: list[str], was_filtered: bool, tmp @pytest.mark.parametrize( ("test_args", "response"), ( - ( - ["--user", "nasa", "--submitted"], - 502, - ), - ( - ["--user", "nasa", "--submitted"], - 504, - ), + (["--user", "nasa", "--submitted"], 502), + (["--user", "nasa", "--submitted"], 504), ), ) def test_user_serv_fail(test_args: list[str], response: int, tmp_path: Path):