icewater
icewater

Reputation: 41

pass test config (test.ini) through nosetests to pyramid

I have seen this, which suggests parsing the config information directly:

passing **settings info to unittest from nose

...but that still requires me to hard-code 'test.ini'. How can I pass the name of the config file through nosetests to my application?

Upvotes: 3

Views: 1021

Answers (1)

Michael Merickel
Michael Merickel

Reputation: 23331

Pylons did this in the past by registering a special nose plugin that added the --with-pylons=test.ini option to nose. I might recommend just setting an environment variable with the filename and dealing with it that way.

export TEST_INI="test.ini"
env/bin/nosetests
import os

ini_file = os.environ['TEST_INI']

Upvotes: 2

Related Questions