From 4a450e140d060f67904b8a8b077d4777df4c7c43 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Thu, 21 Mar 2024 15:48:16 +0900 Subject: [PATCH] windows dammit --- smart_open/tests/test_compression.py | 13 ------------- smart_open/tests/test_smart_open.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/smart_open/tests/test_compression.py b/smart_open/tests/test_compression.py index 0675086e..56ec100e 100644 --- a/smart_open/tests/test_compression.py +++ b/smart_open/tests/test_compression.py @@ -7,7 +7,6 @@ # import gzip import io -import tempfile import pytest import zstandard as zstd @@ -43,15 +42,3 @@ def label(thing, name): def test_compression_wrapper_read(fileobj, compression, filename): wrapped = smart_open.compression.compression_wrapper(fileobj, 'rb', compression, filename) assert wrapped.read() == plain - - -def test_zst_write(): - with tempfile.NamedTemporaryFile(suffix=".zst") as tmp: - with smart_open.open(tmp.name, "wt") as fout: - print("hello world", file=fout) - print("this is a test", file=fout) - - with smart_open.open(tmp.name, "rt") as fin: - got = list(fin) - - assert got == ["hello world\n", "this is a test\n"] diff --git a/smart_open/tests/test_smart_open.py b/smart_open/tests/test_smart_open.py index 067ea19b..4b7c9d32 100644 --- a/smart_open/tests/test_smart_open.py +++ b/smart_open/tests/test_smart_open.py @@ -77,6 +77,18 @@ def named_temporary_file(mode='w+b', prefix=None, suffix=None, delete=True): logger.error(e) +def test_zst_write(): + with tempfile.NamedTemporaryFile(suffix=".zst") as tmp: + with smart_open.open(tmp.name, "wt") as fout: + print("hello world", file=fout) + print("this is a test", file=fout) + + with smart_open.open(tmp.name, "rt") as fin: + got = list(fin) + + assert got == ["hello world\n", "this is a test\n"] + + class ParseUriTest(unittest.TestCase): """ Test ParseUri class.