Skip to content

Commit 6e6f91c

Browse files
committed
Adapt test for increased buffer size in Python 3.14
- default buffer size has increased from 8 kB to 128 kB
1 parent 87b740d commit 6e6f91c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ The released versions correspond to PyPI releases.
1818
* fixed handling of dynamic imports from code in the fake filesystem in Python > 3.11
1919
(see [#1121](../../issues/1121))
2020

21+
### Infrastructure
22+
* adapt test for increased default buffer size in Python 3.14a6
23+
2124
## [Version 5.8.0](https://pypi.python.org/pypi/pyfakefs/5.8.0) (2025-03-11)
2225
Adds preliminary support for Python 3.14.
2326

pyfakefs/tests/fake_open_test.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1227,26 +1227,26 @@ def test_writing_text_with_line_buffer(self):
12271227
def test_writing_large_text_with_line_buffer(self):
12281228
file_path = self.make_path("buffertest.bin")
12291229
with self.open(file_path, "w", encoding="utf8", buffering=1) as f:
1230-
f.write("test" * 4000)
1230+
f.write("test" * 33000)
12311231
with self.open(file_path, "r", encoding="utf8") as r:
12321232
x = r.read()
12331233
# buffer larger than default - written
1234-
self.assertEqual(16000, len(x))
1234+
self.assertEqual(132000, len(x))
12351235
f.write("test")
12361236
with self.open(file_path, "r", encoding="utf8") as r:
12371237
x = r.read()
12381238
# buffer not filled - not written
1239-
self.assertEqual(16000, len(x))
1239+
self.assertEqual(132000, len(x))
12401240
f.write("\ntest")
12411241
with self.open(file_path, "r", encoding="utf8") as r:
12421242
x = r.read()
12431243
# new line - buffer written
1244-
self.assertEqual(16009, len(x))
1244+
self.assertEqual(132009, len(x))
12451245
f.write("\ntest")
12461246
with self.open(file_path, "r", encoding="utf8") as r:
12471247
x = r.read()
12481248
# another new line - buffer written
1249-
self.assertEqual(16014, len(x))
1249+
self.assertEqual(132014, len(x))
12501250

12511251
def test_writing_text_with_default_buffer(self):
12521252
file_path = self.make_path("buffertest.txt")

0 commit comments

Comments
 (0)