Skip to content

Adapt test for increased buffer size in Python 3.14 #1150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The released versions correspond to PyPI releases.
* fixed handling of dynamic imports from code in the fake filesystem in Python > 3.11
(see [#1121](../../issues/1121))

### Infrastructure
* adapt test for increased default buffer size in Python 3.14a6

## [Version 5.8.0](https://pypi.python.org/pypi/pyfakefs/5.8.0) (2025-03-11)
Adds preliminary support for Python 3.14.

Expand Down
10 changes: 5 additions & 5 deletions pyfakefs/tests/fake_open_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,26 +1227,26 @@ def test_writing_text_with_line_buffer(self):
def test_writing_large_text_with_line_buffer(self):
file_path = self.make_path("buffertest.bin")
with self.open(file_path, "w", encoding="utf8", buffering=1) as f:
f.write("test" * 4000)
f.write("test" * 33000)
with self.open(file_path, "r", encoding="utf8") as r:
x = r.read()
# buffer larger than default - written
self.assertEqual(16000, len(x))
self.assertEqual(132000, len(x))
f.write("test")
with self.open(file_path, "r", encoding="utf8") as r:
x = r.read()
# buffer not filled - not written
self.assertEqual(16000, len(x))
self.assertEqual(132000, len(x))
f.write("\ntest")
with self.open(file_path, "r", encoding="utf8") as r:
x = r.read()
# new line - buffer written
self.assertEqual(16009, len(x))
self.assertEqual(132009, len(x))
f.write("\ntest")
with self.open(file_path, "r", encoding="utf8") as r:
x = r.read()
# another new line - buffer written
self.assertEqual(16014, len(x))
self.assertEqual(132014, len(x))

def test_writing_text_with_default_buffer(self):
file_path = self.make_path("buffertest.txt")
Expand Down
Loading