tests: added special no-newline test name generator
This commit is contained in:
parent
dfec9d48a2
commit
196813bfdd
1 changed files with 15 additions and 1 deletions
|
|
@ -56,7 +56,7 @@ log = logging.getLogger(__name__)
|
|||
__all__ = [
|
||||
'get_new_dir', 'TestController', 'SkipTest',
|
||||
'url', 'link_to', 'ldap_lib_installed', 'clear_all_caches',
|
||||
'assert_session_flash', 'login_user',
|
||||
'assert_session_flash', 'login_user', 'no_newline_id_generator',
|
||||
'TESTS_TMP_PATH', 'HG_REPO', 'GIT_REPO', 'SVN_REPO',
|
||||
'NEW_HG_REPO', 'NEW_GIT_REPO',
|
||||
'HG_FORK', 'GIT_FORK', 'TEST_USER_ADMIN_LOGIN', 'TEST_USER_ADMIN_PASS',
|
||||
|
|
@ -249,3 +249,17 @@ def assert_session_flash_is_empty(response):
|
|||
msg = 'flash messages are present in session:%s' % \
|
||||
response.session['flash'][0]
|
||||
pytest.fail(safe_str(msg))
|
||||
|
||||
|
||||
def no_newline_id_generator(test_name):
|
||||
"""
|
||||
Generates a test name without spaces or newlines characters. Used for
|
||||
nicer output of progress of test
|
||||
"""
|
||||
org_name = test_name
|
||||
test_name = test_name\
|
||||
.replace('\n', '_N') \
|
||||
.replace('\t', '_T') \
|
||||
.replace(' ', '_S')
|
||||
|
||||
return test_name or 'test-with-empty-name'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue