diff options
| author | Cody Logan <cody@lokken.dev> | 2023-11-03 10:40:07 -0700 |
|---|---|---|
| committer | Cody Logan <cody@lokken.dev> | 2023-11-03 10:40:07 -0700 |
| commit | 08a5907bd8b34e2f99a0c74e6756c66134ceb7d3 (patch) | |
| tree | 62465f3adaae1c9cca0734f79931783407d8d854 /tests/test_parse.py | |
| parent | bc5d19c8150bf7960839243ceeb6f62a9df54e18 (diff) | |
| download | wikiget-08a5907bd8b34e2f99a0c74e6756c66134ceb7d3.tar.gz wikiget-08a5907bd8b34e2f99a0c74e6756c66134ceb7d3.zip | |
Move from unittest.mock to pytest's monkeypatch where feasible
Diffstat (limited to 'tests/test_parse.py')
| -rw-r--r-- | tests/test_parse.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py index e767597..e0ac707 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -29,7 +29,7 @@ from wikiget.wikiget import parse_args class TestGetDest: - @pytest.fixture(scope="class") + @pytest.fixture def file_with_filename(self) -> File: """ When a filename is passed to get_dest, it should create a File object with the @@ -47,7 +47,7 @@ class TestGetDest: def test_get_dest_site_with_filename(self, file_with_filename: File) -> None: assert file_with_filename.site == "commons.wikimedia.org" - @pytest.fixture(scope="class") + @pytest.fixture def file_with_url(self) -> File: """ When a URL is passed to get_dest, it should create a File object with the @@ -92,7 +92,7 @@ class TestGetDest: class TestReadBatchFile: - @pytest.fixture() + @pytest.fixture def dl_dict(self, tmp_path: Path) -> Dict[int, str]: """ Create and process a test batch file with three lines, returning a dictionary. @@ -129,7 +129,7 @@ class TestReadBatchFile: expected_list = {1: "File:Foo.jpg", 2: "File:Bar.jpg", 3: "File:Baz.jpg"} assert dl_dict == expected_list - @pytest.fixture() + @pytest.fixture def dl_dict_stdin(self, monkeypatch: pytest.MonkeyPatch) -> Dict[int, str]: """ Pass three lines of filenames from stdin to read_batch_file and return a dict. @@ -165,7 +165,7 @@ class TestReadBatchFile: expected_list = {1: "File:Foo.jpg", 2: "File:Bar.jpg", 3: "File:Baz.jpg"} assert dl_dict_stdin == expected_list - @pytest.fixture() + @pytest.fixture def dl_dict_with_comment(self, tmp_path: Path) -> Dict[int, str]: """ Create and process a test batch file with four lines, one of which is |
