We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8cf4ab4 commit 4ff4e63Copy full SHA for 4ff4e63
pandas/tests/test_common.py
@@ -1,6 +1,8 @@
1
import collections
2
from functools import partial
3
import string
4
+import subprocess
5
+import sys
6
7
import numpy as np
8
import pytest
@@ -229,3 +231,17 @@ def test_temp_setattr(with_exception):
229
231
raise ValueError("Inside exception raised")
230
232
raise ValueError("Outside exception raised")
233
assert ser.name == "first"
234
+
235
236
+def test_str_size():
237
+ # GH#21758
238
+ a = "a"
239
+ expected = sys.getsizeof(a)
240
+ pyexe = sys.executable.replace("\\", "/")
241
+ call = [
242
+ pyexe,
243
+ "-c",
244
+ "a='a';import sys;sys.getsizeof(a);import pandas;print(sys.getsizeof(a));",
245
+ ]
246
+ result = subprocess.check_output(call).decode()[-4:-1].strip("\n")
247
+ assert int(result) == int(expected)
0 commit comments