From 560a652e4f27cfc4c17a7279c788c5820a1a112d Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Wed, 2 Sep 2020 15:49:23 -0700 Subject: Simplify writing to tmp_file --- test/test_validations.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/test_validations.py b/test/test_validations.py index 8322c7e..aecee50 100644 --- a/test/test_validations.py +++ b/test/test_validations.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # wikiget - CLI tool for downloading files from Wikimedia sites -# Copyright (C) 2018, 2019 Cody Logan +# Copyright (C) 2018, 2019, 2020 Cody Logan # SPDX-License-Identifier: GPL-3.0-or-later # # Wikiget is free software: you can redistribute it and/or modify @@ -86,8 +86,6 @@ def test_verify_hash(tmp_path): file_sha1 = '8843d7f92416211de9ebb963ff4ce28125932878' tmp_file = tmp_path / file_name - - with tmp_file.open('w') as f: - f.write(file_contents) + tmp_file.write_text(file_contents) assert verify_hash(tmp_file) == file_sha1 -- cgit v1.2.3