EliAndrewC / sideboard

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Sideboard should not run initialize_db on startup for tests #22

Closed EliAndrewC closed 8 years ago

EliAndrewC commented 10 years ago

sideboard.lib.sa.Session when subclassed provides an initialize_db call which is called at import time. This is what we want when Sideboard runs, but not when running unit tests.

Because we run our unit tests with py.test, we should probably just say something like if sys.argv[0] != "py.test" before running initialize_db, which will e.g. prevent us from needing a postgres database on Jenkins when all we're doing is using sqlite.

robdennis commented 10 years ago

The prevention of initialize_db could be done via py.test fixture in the top level conftest.py

On Mon, Mar 24, 2014 at 6:56 PM, Eli Courtwright notifications@github.com wrote:

sideboard.lib.sa.Session when subclassed provides an initialize_db call which is called at import time. This is what we want when Sideboard runs, but not when running unit tests.

Because we run our unit tests with py.test, we should probably just say something like if sys.argv[0] != "py.test" before running initialize_db, which will e.g. prevent us from needing a postgres database on Jenkins when all we're doing is using sqlite.

Reply to this email directly or view it on GitHub: https://github.com/appliedsec/sideboard/issues/22