Changeset - 70d3a838a9f4
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 9 years ago 2016-11-20 21:28:04
thomas.de.schampheleire@gmail.com
tests: remove unused code from conftest.py

conftest.py does not contain an import of pylons (only of pylons.test) so
usage of e.g. pylons.config can never work, so it cannot be used.
Since the tests run fine regardless, we can get rid of this code.
1 file changed with 0 insertions and 9 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/conftest.py
Show inline comments
 
@@ -14,33 +14,24 @@ from kallithea.tests.base import invalid
 

	
 

	
 
def pytest_configure():
 
    path = os.getcwd()
 
    sys.path.insert(0, path)
 
    pkg_resources.working_set.add_entry(path)
 

	
 
    # Disable INFO logging of test database creation, restore with NOTSET
 
    logging.disable(logging.INFO)
 
    pylons.test.pylonsapp = loadapp('config:kallithea/tests/test.ini', relative_to=path)
 
    logging.disable(logging.NOTSET)
 

	
 
    # Setup the config and app_globals, only works if we can get
 
    # to the config object
 
    conf = getattr(pylons.test.pylonsapp, 'config')
 
    if conf:
 
        pylons.config._push_object(conf)
 

	
 
        if 'pylons.app_globals' in conf:
 
            pylons.app_globals._push_object(conf['pylons.app_globals'])
 

	
 
    # Initialize a translator for tests that utilize i18n
 
    translator = _get_translator(pylons.config.get('lang'))
 
    pylons.translator._push_object(translator)
 

	
 
    return pylons.test.pylonsapp
 

	
 

	
 
@pytest.yield_fixture
 
def create_test_user():
 
    """Provide users that automatically disappear after test is over."""
 
    test_user_ids = []
 
    def _create_test_user(user_form):
0 comments (0 inline, 0 general)