Changeset - 8a1caf0f2592
[Not reviewed]
default
0 3 0
Thomas De Schampheleire - 8 years ago 2018-03-16 22:08:46
thomas.de_schampheleire@nokia.com
Grafted from: b268a91367c6
tests: vcs: recreate_repo_per_test is really optional

While the documentation says this attribute is required, most tests do not
set it when the default value is fine. Follow-through that convention and
update the documentation.
3 files changed with 1 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/vcs/base.py
Show inline comments
 
@@ -15,13 +15,13 @@ from kallithea.tests.vcs.conf import get
 

	
 
class _BackendTestMixin(object):
 
    """
 
    This is a backend independent test case class which should be created
 
    with ``type`` method.
 

	
 
    It is required to set following attributes at subclass:
 
    It is possible to set following attributes at subclass:
 

	
 
    - ``backend_alias``: alias of used backend (see ``vcs.BACKENDS``)
 
    - ``recreate_repo_per_test``: If set to ``False``, repo would NOT be created
 
      before every single test. Defaults to ``True``.
 
    """
 
    recreate_repo_per_test = True
kallithea/tests/vcs/test_changesets.py
Show inline comments
 
@@ -50,13 +50,12 @@ class TestBaseChangeset(object):
 
            'changed': [],
 
            'removed': [],
 
        }
 

	
 

	
 
class _ChangesetsWithCommitsTestCaseixin(_BackendTestMixin):
 
    recreate_repo_per_test = True
 

	
 
    @classmethod
 
    def _get_commits(cls):
 
        start_date = datetime.datetime(2010, 1, 1, 20)
 
        for x in xrange(5):
 
            yield {
kallithea/tests/vcs/test_inmemchangesets.py
Show inline comments
 
@@ -22,14 +22,12 @@ from kallithea.lib.vcs.utils import safe
 

	
 
from kallithea.tests.vcs.base import _BackendTestMixin
 

	
 

	
 
class InMemoryChangesetTestMixin(_BackendTestMixin):
 

	
 
    recreate_repo_per_test = True
 

	
 
    @classmethod
 
    def _get_commits(cls):
 
        # Note: this is slightly different than the regular _get_commits methods
 
        # as we don't actually return any commits. The creation of commits is
 
        # handled in the tests themselves.
 
        cls.nodes = [
0 comments (0 inline, 0 general)