Skip to content

Commit 3830c55

Browse files
committed
Use fixture for TTest
1 parent 3998cb4 commit 3830c55

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/test_relation.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ def test_wrong_insert_type(user):
128128
user.insert1(3)
129129

130130

131-
def test_insert_select(subject, test2):
131+
def test_insert_select(subject, test, test2):
132132
test2.delete()
133-
test2.insert(schema.TTest)
134-
assert len(test2) == len(schema.TTest())
133+
test2.insert(test)
134+
assert len(test2) == len(test)
135135

136136
original_length = len(subject)
137137
elements = subject.proj(..., s="subject_id")
@@ -146,27 +146,27 @@ def test_insert_select(subject, test2):
146146
assert len(subject) == 2 * original_length
147147

148148

149-
def test_insert_pandas_roundtrip(test2):
149+
def test_insert_pandas_roundtrip(test, test2):
150150
"""ensure fetched frames can be inserted"""
151151
test2.delete()
152-
n = len(schema.TTest())
152+
n = len(test)
153153
assert n > 0
154-
df = schema.TTest.fetch(format="frame")
154+
df = test.fetch(format="frame")
155155
assert isinstance(df, pandas.DataFrame)
156156
assert len(df) == n
157157
test2.insert(df)
158158
assert len(test2) == n
159159

160160

161-
def test_insert_pandas_userframe(test2):
161+
def test_insert_pandas_userframe(test, test2):
162162
"""
163163
ensure simple user-created frames (1 field, non-custom index)
164164
can be inserted without extra index adjustment
165165
"""
166166
test2.delete()
167-
n = len(schema.TTest())
167+
n = len(test)
168168
assert n > 0
169-
df = pandas.DataFrame(schema.TTest.fetch())
169+
df = pandas.DataFrame(test.fetch())
170170
assert isinstance(df, pandas.DataFrame)
171171
assert len(df) == n
172172
test2.insert(df)

0 commit comments

Comments
 (0)