Changeset - 07dbfabb8fea
[Not reviewed]
default
0 0 1
Marc Abramowitz - 11 years ago 2015-04-08 01:21:12
marc@marc-abramowitz.com
tests: Add conftest.py for pytest

This adds a conftest.py for pytest that initializes the Pylons app so that the
SQLAlchemy session is bound and such.

This is sort of the Python analogue for the nosetest plugin that Pylons
includes: https://github.com/Pylons/pylons/blob/master/pylons/test.py
1 file changed with 14 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/conftest.py
Show inline comments
 
new file 100644
 
import os
 
import sys
 

	
 
import pkg_resources
 
from paste.deploy import loadapp
 
import pylons.test
 

	
 

	
 
def pytest_configure():
 
    path = os.getcwd()
 
    sys.path.insert(0, path)
 
    pkg_resources.working_set.add_entry(path)
 
    pylons.test.pylonsapp = loadapp('config:test.ini', relative_to=path)
 
    return pylons.test.pylonsapp
0 comments (0 inline, 0 general)