本文整理汇总了Python中testenv.main函数的典型用法代码示例。如果您正苦于以下问题:Python main函数的具体用法?Python main怎么用?Python main使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了main函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: suite
import testenv; testenv.configure_for_tests()
import unittest
import orm.alltests as orm
import base.alltests as base
import sql.alltests as sql
import engine.alltests as engine
import dialect.alltests as dialect
import ext.alltests as ext
import zblog.alltests as zblog
import profiling.alltests as profiling
# The profiling tests are sensitive to foibles of CPython VM state, so
# run them first. Ideally, each should be run in a fresh interpreter.
def suite():
alltests = unittest.TestSuite()
for suite in (profiling, base, engine, sql, dialect, orm, ext, zblog):
alltests.addTest(suite.suite())
return alltests
if __name__ == '__main__':
testenv.main(suite())
示例2: setattr
setattr(self, '_value', value)
value = property(_getValue, _setValue)
mapper(User, users, properties={
'uid':synonym('id'),
'foobar':comparable_property(User.Comparator,User.value),
})
sess = create_session()
u = User()
u.name = 'ed'
sess.save(u)
sess.flush()
sess.expunge(u)
sess.merge(u)
@testing.resolve_artifact_names
def test_cascades_dont_autoflush(self):
sess = create_session(autoflush=True)
m = mapper(User, users, properties={
'addresses':relation(mapper(Address, addresses),backref='user')})
user = User(id=8, name='fred', addresses=[Address(email_address='user')])
merged_user = sess.merge(user)
assert merged_user in sess.new
sess.flush()
assert merged_user not in sess.new
if __name__ == "__main__":
testenv.main()