nose unit tests

28 views
Skip to first unread message

pkraus

unread,
Feb 11, 2012, 4:56:23 PM2/11/12
to turbo...@googlegroups.com
I have never done unit testing and I am trying to learn/apply it to a tg2.1 project that  have. The initial tests are failing and I am not sure where to track down the problem. Looking at the below error can you suggest what might be causing the issue? I have added no new tests, and I have not changed any of the default tests.

TIA!
PK

ERROR: Voluntary logins must work correctly
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/nose-1.0.0-py2.6.egg/nose/case.py", line 371, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/nose-1.0.0-py2.6.egg/nose/util.py", line 478, in try_run
    return func()
  File "/home/pkraus/turbogears/erp_beta/src/erp/tests/__init__.py", line 57, in setUp
    cmd.run([test_file])
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/PasteScript-1.7.4.2-py2.6.egg/paste/script/appinstall.py", line 68, in run
    return super(AbstractInstallCommand, self).run(new_args)
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/PasteScript-1.7.4.2-py2.6.egg/paste/script/command.py", line 238, in run
    result = self.command()
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/PasteScript-1.7.4.2-py2.6.egg/paste/script/appinstall.py", line 456, in command
    self, config_file, section, self.sysconfig_install_vars(installer))
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/PasteScript-1.7.4.2-py2.6.egg/paste/script/appinstall.py", line 598, in setup_config
    mod.setup_app, command, filename, section, vars)
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/PasteScript-1.7.4.2-py2.6.egg/paste/script/appinstall.py", line 614, in _call_setup_app
    func(command, conf, vars)
  File "/home/pkraus/turbogears/erp_beta/src/erp/websetup/__init__.py", line 18, in setup_app
    setup_schema(command, conf, vars)
  File "/home/pkraus/turbogears/erp_beta/src/erp/websetup/schema.py", line 35, in setup_schema
    main(argv=['version_control'], url=config['sqlalchemy.url'], repository='migration', name='migration')
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/sqlalchemy_migrate-0.7.2-py2.6.egg/migrate/versioning/shell.py", line 207, in main
    ret = command_func(**kwargs)
  File "<string>", line 2, in version_control
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/sqlalchemy_migrate-0.7.2-py2.6.egg/migrate/versioning/util/__init__.py", line 159, in with_engine
    return f(*a, **kw)
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/sqlalchemy_migrate-0.7.2-py2.6.egg/migrate/versioning/api.py", line 250, in version_control
    ControlledSchema.create(engine, repository, version)
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/sqlalchemy_migrate-0.7.2-py2.6.egg/migrate/versioning/schema.py", line 137, in create
    repository = Repository(repository)
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/sqlalchemy_migrate-0.7.2-py2.6.egg/migrate/versioning/repository.py", line 77, in __init__
    self.verify(path)
  File "/home/pkraus/turbogears/erp_beta/lib/python2.6/site-packages/sqlalchemy_migrate-0.7.2-py2.6.egg/migrate/versioning/repository.py", line 98, in verify
    raise exceptions.InvalidRepositoryError(path)
InvalidRepositoryError: migration

pkraus

unread,
Feb 11, 2012, 5:37:27 PM2/11/12
to turbo...@googlegroups.com
Figured this out. I have some code in boot script that reads a csv file to load in some users. I just needed to change the cwd back to the original directory.

At any rate all fixed.
Reply all
Reply to author
Forward
0 new messages