Skip to content

Commit 524e7ad

Browse files
committed
Whitespace normalization
1 parent ac21f41 commit 524e7ad

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pony/orm/tests/test_db_session.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def test():
208208
self.assertEqual(count(x for x in self.X), 3)
209209
else:
210210
self.fail()
211-
211+
212212
def test_db_session_decorator_14(self):
213213
# allowed_exceptions may be callable, should rollback if not nonzero
214214
@db_session(allowed_exceptions=lambda e: isinstance(e, TypeError))
@@ -322,65 +322,78 @@ class Student(db.Entity):
322322
class TestDBSessionScope(unittest.TestCase):
323323
def setUp(self):
324324
rollback()
325+
325326
def tearDown(self):
326327
rollback()
328+
327329
def test1(self):
328330
with db_session:
329331
s1 = Student[1]
330332
name = s1.name
333+
331334
@raises_exception(DatabaseSessionIsOver, 'Cannot load attribute Student[1].picture: the database session is over')
332335
def test2(self):
333336
with db_session:
334337
s1 = Student[1]
335338
picture = s1.picture
339+
336340
@raises_exception(DatabaseSessionIsOver, 'Cannot load attribute Group[1].major: the database session is over')
337341
def test3(self):
338342
with db_session:
339343
s1 = Student[1]
340344
group_id = s1.group.id
341345
major = s1.group.major
346+
342347
@raises_exception(DatabaseSessionIsOver, 'Cannot assign new value to attribute Student[1].name: the database session is over')
343348
def test4(self):
344349
with db_session:
345350
s1 = Student[1]
346351
s1.name = 'New name'
352+
347353
def test5(self):
348354
with db_session:
349355
g1 = Group[1]
350356
self.assertEqual(str(g1.students), 'StudentSet([...])')
357+
351358
@raises_exception(DatabaseSessionIsOver, 'Cannot load collection Group[1].students: the database session is over')
352359
def test6(self):
353360
with db_session:
354361
g1 = Group[1]
355362
l = len(g1.students)
363+
356364
@raises_exception(DatabaseSessionIsOver, 'Cannot change collection Group[1].Group.students: the database session is over')
357365
def test7(self):
358366
with db_session:
359367
s1 = Student[1]
360368
g1 = Group[1]
361369
g1.students.remove(s1)
370+
362371
@raises_exception(DatabaseSessionIsOver, 'Cannot change collection Group[1].Group.students: the database session is over')
363372
def test8(self):
364373
with db_session:
365374
g2_students = Group[2].students
366375
g1 = Group[1]
367376
g1.students = g2_students
377+
368378
@raises_exception(DatabaseSessionIsOver, 'Cannot change collection Group[1].Group.students: the database session is over')
369379
def test9(self):
370380
with db_session:
371381
s3 = Student[3]
372382
g1 = Group[1]
373383
g1.students.add(s3)
384+
374385
@raises_exception(DatabaseSessionIsOver, 'Cannot change collection Group[1].Group.students: the database session is over')
375386
def test10(self):
376387
with db_session:
377388
g1 = Group[1]
378389
g1.students.clear()
390+
379391
@raises_exception(DatabaseSessionIsOver, 'Cannot delete object Student[1]: the database session is over')
380392
def test11(self):
381393
with db_session:
382394
s1 = Student[1]
383395
s1.delete()
396+
384397
@raises_exception(DatabaseSessionIsOver, 'Cannot change object Student[1]: the database session is over')
385398
def test12(self):
386399
with db_session:

0 commit comments

Comments
 (0)