<commit_before>import pytest

from plenum.server.view_change.node_view_changer import create_view_changer
from stp_core.common.log import getlogger

from plenum.test.helper import sdk_send_random_and_check

from plenum.test.test_node import TestNode, TestViewChanger
from plenum.test.view_change.helper import ensure_view_change_complete

from plenum.test.node_catchup.helper import waitNodeDataEquality

logger = getlogger()


class TestViewChangerWithAdjustedViewNo(TestViewChanger):
    def __init__(self, *args, **kwargs):
        self.__view_no = 3
        super().__init__(*args, **kwargs)

    @property
    def view_no(self):
        return self.__view_no

    @view_no.setter
    def view_no(self, value):
        if value != 0:
            self.__view_no = value


class TestNodeWithAdjustedViewNo(TestNode):
    def newViewChanger(self):
        return create_view_changer(self, TestViewChangerWithAdjustedViewNo)


@pytest.fixture(scope="module")
def testNodeClass(patchPluginManager):
    return TestNodeWithAdjustedViewNo


@pytest.fixture("module")
def txnPoolNodeSet(txnPoolNodeSet, looper, sdk_pool_handle, sdk_wallet_steward,
                   tconf, tdirWithPoolTxns, allPluginsPath):
    logger.debug("Do several view changes to round the list of primaries")<commit_msg>Test fix<commit_after>import pytest

from plenum.server.view_change.node_view_changer import create_view_changer
from stp_core.common.log import getlogger

from plenum.test.helper import sdk_send_random_and_check

from plenum.test.test_node import TestNode, TestViewChanger
from plenum.test.view_change.helper import ensure_view_change_complete

from plenum.test.node_catchup.helper import waitNodeDataEquality

logger = getlogger()


class TestViewChangerWithAdjustedViewNo(TestViewChanger):
    def __init__(self, *args, **kwargs):
        self.__view_no = 3
        super().__init__(*args, **kwargs)

    @property
    def view_no(self):
        return self.__view_no

    @view_no.setter
    def view_no(self, value):
        if value != 0:
            self.__view_no = value
            self.provider.view_setting_handler(value)


class TestNodeWithAdjustedViewNo(TestNode):
    def newViewChanger(self):
        return create_view_changer(self, TestViewChangerWithAdjustedViewNo)


@pytest.fixture(scope="module")
def testNodeClass(patchPluginManager):
    return TestNodeWithAdjustedViewNo


@pytest.fixture("module")
def txnPoolNodeSet(txnPoolNodeSet, looper, sdk_pool_handle, sdk_wallet_steward,
                   tconf, tdirWithPoolTxns, allPluginsPath):
    logger.debug("Do several view changes to round the list of primaries")
{'fraction_non_alphanumeric': 0.07677689091600153, 'fraction_numerical': 0.0015203344735841885, 'mean_word_length': 4.564482029598309, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7250746', 'n_tokens_mistral': 840, 'n_tokens_neox': 831, 'n_words': 169}