@@ -31,8 +31,8 @@ def subject():
3131 yield schema.Subject()
3232
3333
34-
3534class TestFetch:
35+ @pytest.mark.skip(reason='temp')
3636 def test_getattribute(self, schema_any, subject):
3737 """Testing Fetch.__call__ with attributes"""
3838 list1 = sorted(
@@ -56,25 +56,25 @@ def test_getattribute(self, schema_any, subject):
5656 for l1, l2 in zip(list1, list2):
5757 assert l1 == l2, "Primary key is not returned correctly"
5858
59+ @pytest.mark.skip(reason='temp')
5960 def test_getattribute_for_fetch1(self, schema_any, subject):
6061 """Testing Fetch1.__call__ with attributes"""
6162 assert (subject & "subject_id=10").fetch1("subject_id") == 10
6263 assert (
6364 (subject & "subject_id=10").fetch1("subject_id", "species") ==
6465 (10, "monkey"))
6566
67+ @pytest.mark.skip(reason='temp')
6668 def test_order_by(self, schema_any, lang, languages):
6769 """Tests order_by sorting order"""
6870 for ord_name, ord_lang in itertools.product(*2 * [["ASC", "DESC"]]):
6971 cur = lang.fetch(order_by=("name " + ord_name, "language " + ord_lang))
7072 languages.sort(key=itemgetter(1), reverse=ord_lang == "DESC")
7173 languages.sort(key=itemgetter(0), reverse=ord_name == "DESC")
7274 for c, l in zip(cur, languages):
73- assert (
74- np.all(cc == ll for cc, ll in zip(c, l)),
75- "Sorting order is different",
76- )
75+ assert np.all(cc == ll for cc, ll in zip(c, l)), "Sorting order is different"
7776
77+ @pytest.mark.skip(reason='temp')
7878 def test_order_by_default(self, schema_any, lang, languages):
7979 """Tests order_by sorting order with defaults"""
8080 cur = lang.fetch(order_by=("language", "name DESC"))
@@ -83,12 +83,14 @@ def test_order_by_default(self, schema_any, lang, languages):
8383 for c, l in zip(cur, languages):
8484 assert np.all([cc == ll for cc, ll in zip(c, l)]), "Sorting order is different"
8585
86+ @pytest.mark.skip(reason='temp')
8687 def test_limit(self, schema_any, lang):
8788 """Test the limit kwarg"""
8889 limit = 4
8990 cur = lang.fetch(limit=limit)
9091 assert len(cur) == limit, "Length is not correct"
9192
93+ @pytest.mark.skip(reason='temp')
9294 def test_order_by_limit(self, schema_any, lang, languages):
9395 """Test the combination of order by and limit kwargs"""
9496 cur = lang.fetch(limit=4, order_by=["language", "name DESC"])
@@ -98,6 +100,7 @@ def test_order_by_limit(self, schema_any, lang, languages):
98100 for c, l in list(zip(cur, languages))[:4]:
99101 assert np.all([cc == ll for cc, ll in zip(c, l)]), "Sorting order is different"
100102
103+ @pytest.mark.skip(reason='temp')
101104 def test_head_tail(self, schema_any):
102105 query = schema.User * schema.Language
103106 n = 5
@@ -115,6 +118,7 @@ def test_head_tail(self, schema_any):
115118 assert len(frame) == n
116119 assert query.primary_key == frame.index.names
117120
121+ @pytest.mark.skip(reason='temp')
118122 def test_limit_offset(self, schema_any, lang, languages):
119123 """Test the limit and offset kwargs together"""
120124 cur = lang.fetch(offset=2, limit=4, order_by=["language", "name DESC"])
@@ -124,6 +128,7 @@ def test_limit_offset(self, schema_any, lang, languages):
124128 for c, l in list(zip(cur, languages[2:6])):
125129 assert np.all([cc == ll for cc, ll in zip(c, l)]), "Sorting order is different"
126130
131+ @pytest.mark.skip(reason='temp')
127132 def test_iter(self, schema_any, lang, languages):
128133 """Test iterator"""
129134 cur = lang.fetch(order_by=["language", "name DESC"])
@@ -134,11 +139,9 @@ def test_iter(self, schema_any, lang, languages):
134139 # now as dict
135140 cur = lang.fetch(as_dict=True, order_by=("language", "name DESC"))
136141 for row, (tname, tlang) in list(zip(cur, languages)):
137- assert (
138- row["name"] == tname and row["language"] == tlang,
139- "Values are not the same",
140- )
142+ assert row["name"] == tname and row["language"] == tlang, "Values are not the same"
141143
144+ @pytest.mark.skip(reason='temp')
142145 def test_keys(self, schema_any, lang, languages):
143146 """test key fetch"""
144147 languages.sort(key=itemgetter(0), reverse=True)
@@ -151,6 +154,7 @@ def test_keys(self, schema_any, lang, languages):
151154 for c, c2 in zip(zip(*cur), cur2):
152155 assert c == tuple(c2.values()), "Values are not the same"
153156
157+ @pytest.mark.skip(reason='temp')
154158 def test_attributes_as_dict(self, schema_any, subject):
155159 """
156160 Issue #595
@@ -160,6 +164,7 @@ def test_attributes_as_dict(self, schema_any, subject):
160164 assert bool(result) and len(result) == len(subject)
161165 assert set(result[0]) == set(attrs)
162166
167+ @pytest.mark.skip(reason='temp')
163168 def test_fetch1_step1(self, schema_any, lang, languages):
164169 assert lang.contents == languages == [
165170 ("Fabian", "English"),
@@ -175,10 +180,12 @@ def test_fetch1_step1(self, schema_any, lang, languages):
175180 for k, (ke, c) in zip(true, dat.items()):
176181 assert k == c == (lang & key).fetch1(ke), "Values are not the same"
177182
183+ @pytest.mark.skip(reason='temp')
178184 def test_misspelled_attribute(self, schema_any):
179185 with pytest.raises(dj.DataJointError):
180186 f = (schema.Language & 'lang = "ENGLISH"').fetch()
181187
188+ @pytest.mark.skip(reason='temp')
182189 def test_repr(self, schema_any, subject):
183190 """Test string representation of fetch, returning table preview"""
184191 repr = subject.fetch.__repr__()
@@ -187,6 +194,7 @@ def test_repr(self, schema_any, subject):
187194 # 3 lines are used for headers (2) and summary statement (1)
188195 assert n - 3 <= limit
189196
197+ @pytest.mark.skip(reason='temp')
190198 def test_fetch_none(self, schema_any, lang):
191199 """Test preparing attributes for getitem"""
192200 with pytest.raises(dj.DataJointError):
@@ -229,15 +237,18 @@ def test_limit_warning(self, schema_any, lang):
229237 logger.removeHandler(handler)
230238 assert "[WARNING]: Offset set, but no limit." in log_contents
231239
240+ @pytest.mark.skip(reason='temp')
232241 def test_len(self, schema_any, lang):
233242 """Tests __len__"""
234243 assert len(lang.fetch()) == len(lang), "__len__ is not behaving properly"
235244
245+ @pytest.mark.skip(reason='temp')
236246 def test_fetch1_step2(self, schema_any, lang):
237247 """Tests whether fetch1 raises error"""
238248 with pytest.raises(dj.DataJointError):
239249 lang.fetch1()
240250
251+ @pytest.mark.skip(reason='temp')
241252 def test_fetch1_step3(self, schema_any, lang):
242253 """Tests whether fetch1 raises error"""
243254 with pytest.raises(dj.DataJointError):
@@ -246,10 +257,13 @@ def test_fetch1_step3(self, schema_any, lang):
246257 def test_decimal(self, schema_any):
247258 """Tests that decimal fields are correctly fetched and used in restrictions, see issue #334"""
248259 rel = schema.DecimalPrimaryKey()
260+ assert bool(schema.DecimalPrimaryKey().fetch()), "Table DecimalPrimaryKey is empty"
249261 rel.insert1([decimal.Decimal("3.1415926")])
250262 keys = rel.fetch()
263+ assert len(keys) > 0
251264 assert len(rel & keys[0]) == 1
252265 keys = rel.fetch(dj.key)
266+ assert len(keys) >= 2
253267 assert len(rel & keys[1]) == 1
254268
255269 def test_nullable_numbers(self, schema_any):
0 commit comments