From 605085c95fe5ab6af337aefc723794f78cf3dfd7 Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Tue, 14 Nov 2023 16:44:34 -0800 Subject: 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. --- tests/test_logging.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_logging.py') 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() -- cgit v1.2.3