diff options
| author | Cody Logan <cody@lokken.dev> | 2023-11-14 16:44:34 -0800 |
|---|---|---|
| committer | Cody Logan <cody@lokken.dev> | 2023-11-14 16:44:34 -0800 |
| commit | 605085c95fe5ab6af337aefc723794f78cf3dfd7 (patch) | |
| tree | f0dfba6e4fe1fa71a0ba48ecd6f098c66c03f30e /tests/test_logging.py | |
| parent | 733eeb27581ee6fc2a9c2d79d7b002127bde85f1 (diff) | |
| download | wikiget-605085c95fe5ab6af337aefc723794f78cf3dfd7.tar.gz wikiget-605085c95fe5ab6af337aefc723794f78cf3dfd7.zip | |
Use fixtures to create test files
This reduces the number of temporary folders and files created
during testing. Additionally, an actual JPEG is created for a couple
tests instead of using random text for the contents.
Diffstat (limited to 'tests/test_logging.py')
| -rw-r--r-- | tests/test_logging.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_logging.py b/tests/test_logging.py index 2fd95cd..8d58cdf 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -39,9 +39,9 @@ class TestLogging: adapter.warning("test log") assert "[Example.jpg] test log" in caplog.text - def test_file_logging(self, tmp_path: Path) -> None: + def test_file_logging(self) -> None: """Logging to a file should create the file in the specified location.""" - logfile_location = tmp_path / "test.log" + logfile_location = Path("test.log") args = parse_args(["File:Example.jpg", "-l", str(logfile_location)]) configure_logging(args.verbose, args.logfile, quiet=args.quiet) assert logfile_location.is_file() |
