From 67e9c094c13fbc375e3ed10c9c98ed2810e67c4f Mon Sep 17 00:00:00 2001 From: David Dashyan Date: Fri, 15 May 2020 14:52:50 +0300 Subject: [PATCH] Fix tests errors related to docs reorganization Signed-off-by: David Dashyan --- .travis.yml | 3 --- bigchaindb/common/transaction.py | 7 ++++--- bigchaindb/core.py | 10 +++++----- tests/backend/localmongodb/test_queries.py | 4 ++-- tests/test_docs.py | 7 ------- tox.ini | 9 +-------- 6 files changed, 12 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index e4acca44..628b333a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,6 @@ env: matrix: - TOXENV=flake8 - TOXENV=docsroot - - TOXENV=docsserver matrix: fast_finish: true @@ -32,8 +31,6 @@ matrix: env: TOXENV=flake8 - python: 3.5 env: TOXENV=docsroot - - python: 3.5 - env: TOXENV=docsserver include: - python: 3.6 env: diff --git a/bigchaindb/common/transaction.py b/bigchaindb/common/transaction.py index a3f17dcd..69960ff7 100644 --- a/bigchaindb/common/transaction.py +++ b/bigchaindb/common/transaction.py @@ -546,7 +546,7 @@ class Transaction(object): elif (operation == self.TRANSFER and not (isinstance(asset, dict) and 'id' in asset)): raise TypeError(('`asset` must be a dict holding an `id` property ' - "for 'TRANSFER' Transactions".format(operation))) + 'for \'TRANSFER\' Transactions')) if outputs and not isinstance(outputs, list): raise TypeError('`outputs` must be a list instance or None') @@ -869,8 +869,9 @@ class Transaction(object): return cls._sign_threshold_signature_fulfillment(input_, message, key_pairs) else: - raise ValueError("Fulfillment couldn't be matched to " - 'Cryptocondition fulfillment type.') + raise ValueError( + 'Fulfillment couldn\'t be matched to ' + 'Cryptocondition fulfillment type.') @classmethod def _sign_simple_signature_fulfillment(cls, input_, message, key_pairs): diff --git a/bigchaindb/core.py b/bigchaindb/core.py index 87cc5819..4898ee94 100644 --- a/bigchaindb/core.py +++ b/bigchaindb/core.py @@ -46,9 +46,9 @@ class App(BaseApplication): self.chain = self.bigchaindb.get_latest_abci_chain() def log_abci_migration_error(self, chain_id, validators): - logger.error(f'An ABCI chain migration is in process. ' + - 'Download the new ABCI client and configure it with ' + - 'chain_id={chain_id} and validators={validators}.') + logger.error('An ABCI chain migration is in process. ' + 'Download the new ABCI client and configure it with ' + f'chain_id={chain_id} and validators={validators}.') def abort_if_abci_chain_is_not_synced(self): if self.chain is None or self.chain['is_synced']: @@ -69,8 +69,8 @@ class App(BaseApplication): chain_id = known_chain['chain_id'] if known_chain['is_synced']: - msg = f'Got invalid InitChain ABCI request ({genesis}) - ' + \ - 'the chain {chain_id} is already synced.' + msg = (f'Got invalid InitChain ABCI request ({genesis}) - ' + f'the chain {chain_id} is already synced.') logger.error(msg) sys.exit(1) diff --git a/tests/backend/localmongodb/test_queries.py b/tests/backend/localmongodb/test_queries.py index 1c587759..1d20854b 100644 --- a/tests/backend/localmongodb/test_queries.py +++ b/tests/backend/localmongodb/test_queries.py @@ -271,8 +271,8 @@ def test_get_spending_transactions_multiple_inputs(): ({'transaction_id': tx3.id, 'output_index': 0}, 1, [tx4.id]), ({'transaction_id': tx3.id, 'output_index': 1}, 0, None), ] - for l, num, match in links: - txns = list(query.get_spending_transactions(conn, [l])) + for li, num, match in links: + txns = list(query.get_spending_transactions(conn, [li])) assert len(txns) == num if len(txns): assert [tx['id'] for tx in txns] == match diff --git a/tests/test_docs.py b/tests/test_docs.py index f5a65676..0cf65cf2 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -7,13 +7,6 @@ import subprocess -def test_build_server_docs(): - proc = subprocess.Popen(['bash'], stdin=subprocess.PIPE) - proc.stdin.write('cd docs/server; make html'.encode()) - proc.stdin.close() - assert proc.wait() == 0 - - def test_build_root_docs(): proc = subprocess.Popen(['bash'], stdin=subprocess.PIPE) proc.stdin.write('cd docs/root; make html'.encode()) diff --git a/tox.ini b/tox.ini index fe8a22da..08d46796 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] skipsdist = true -envlist = py{35,36}, flake8, docsroot, docsserver +envlist = py{35,36}, flake8, docsroot [base] basepython = python3.6 @@ -33,10 +33,3 @@ deps = extras = None commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html -[testenv:docsserver] -basepython = {[base]basepython} -changedir = docs/server/source -@@ -41,3 +41,4 @@ deps = - -r{toxinidir}/docs/server/requirements.txt -extras = None -commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html \ No newline at end of file