Skip to content

Commit

Permalink
windows dammit
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenkov committed Mar 21, 2024
1 parent 4402af8 commit 4a450e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
13 changes: 0 additions & 13 deletions smart_open/tests/test_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#
import gzip
import io
import tempfile

import pytest
import zstandard as zstd
Expand Down Expand Up @@ -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"]
12 changes: 12 additions & 0 deletions smart_open/tests/test_smart_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4a450e1

Please sign in to comment.