Enables stdout for unit tests

By default pytests does not capture stdout, but it can do with -s. It is nice to have the option to verbose the tests if needed
This commit is contained in:
Sergi Delgado Segura
2019-12-17 17:22:40 +01:00
parent d4e7e999e1
commit fffcb39124
12 changed files with 1 additions and 29 deletions

View File

@@ -8,7 +8,7 @@ from cryptography.hazmat.primitives import serialization
from pisa.api import API from pisa.api import API
from pisa.watcher import Watcher from pisa.watcher import Watcher
from pisa.tools import bitcoin_cli from pisa.tools import bitcoin_cli
from pisa import HOST, PORT, c_logger from pisa import HOST, PORT
from pisa.conf import MAX_APPOINTMENTS from pisa.conf import MAX_APPOINTMENTS
from test.pisa.unit.conftest import ( from test.pisa.unit.conftest import (
@@ -21,7 +21,6 @@ from test.pisa.unit.conftest import (
from common.constants import LOCATOR_LEN_BYTES from common.constants import LOCATOR_LEN_BYTES
c_logger.disabled = True
PISA_API = "http://{}:{}".format(HOST, PORT) PISA_API = "http://{}:{}".format(HOST, PORT)
MULTIPLE_APPOINTMENTS = 10 MULTIPLE_APPOINTMENTS = 10

View File

@@ -4,8 +4,6 @@ from pisa import c_logger
from apps.cli.blob import Blob from apps.cli.blob import Blob
from test.pisa.unit.conftest import get_random_value_hex from test.pisa.unit.conftest import get_random_value_hex
c_logger.disabled = True
def test_init_blob(): def test_init_blob():
data = get_random_value_hex(64) data = get_random_value_hex(64)

View File

@@ -4,7 +4,6 @@ from pisa import c_logger
from pisa.block_processor import BlockProcessor from pisa.block_processor import BlockProcessor
from test.pisa.unit.conftest import get_random_value_hex, generate_block, generate_blocks from test.pisa.unit.conftest import get_random_value_hex, generate_block, generate_blocks
c_logger.disabled = True
hex_tx = ( hex_tx = (
"0100000001c997a5e56e104102fa209c6a852dd90660a20b2d9c352423edce25857fcd3704000000004847304402" "0100000001c997a5e56e104102fa209c6a852dd90660a20b2d9c352423edce25857fcd3704000000004847304402"

View File

@@ -1,11 +1,8 @@
from uuid import uuid4 from uuid import uuid4
from pisa import c_logger
from pisa.builder import Builder from pisa.builder import Builder
from test.pisa.unit.conftest import get_random_value_hex, generate_dummy_appointment, generate_dummy_tracker from test.pisa.unit.conftest import get_random_value_hex, generate_dummy_appointment, generate_dummy_tracker
c_logger.disabled = True
def test_build_appointments(): def test_build_appointments():
appointments_data = {} appointments_data = {}

View File

@@ -1,13 +1,11 @@
import pytest import pytest
from pisa import c_logger
from pisa.carrier import Carrier from pisa.carrier import Carrier
from test.simulator.utils import sha256d from test.simulator.utils import sha256d
from test.simulator.transaction import TX from test.simulator.transaction import TX
from test.pisa.unit.conftest import generate_blocks, get_random_value_hex from test.pisa.unit.conftest import generate_blocks, get_random_value_hex
from pisa.rpc_errors import RPC_VERIFY_ALREADY_IN_CHAIN, RPC_DESERIALIZATION_ERROR from pisa.rpc_errors import RPC_VERIFY_ALREADY_IN_CHAIN, RPC_DESERIALIZATION_ERROR
c_logger.disabled = True
# FIXME: This test do not fully cover the carrier since the simulator does not support every single error bitcoind may # FIXME: This test do not fully cover the carrier since the simulator does not support every single error bitcoind may
# return for RPC_VERIFY_REJECTED and RPC_VERIFY_ERROR. Further development of the simulator / mocks or simulation # return for RPC_VERIFY_REJECTED and RPC_VERIFY_ERROR. Further development of the simulator / mocks or simulation

View File

@@ -1,7 +1,6 @@
import random import random
from uuid import uuid4 from uuid import uuid4
from pisa import c_logger
from pisa.responder import TransactionTracker from pisa.responder import TransactionTracker
from pisa.cleaner import Cleaner from pisa.cleaner import Cleaner
from common.appointment import Appointment from common.appointment import Appointment
@@ -16,8 +15,6 @@ ITEMS = 10
MAX_ITEMS = 100 MAX_ITEMS = 100
ITERATIONS = 10 ITERATIONS = 10
c_logger.disabled = True
# WIP: FIX CLEANER TESTS AFTER ADDING delete_complete_appointment # WIP: FIX CLEANER TESTS AFTER ADDING delete_complete_appointment
def set_up_appointments(db_manager, total_appointments): def set_up_appointments(db_manager, total_appointments):

View File

@@ -4,7 +4,6 @@ import pytest
import shutil import shutil
from uuid import uuid4 from uuid import uuid4
from pisa import c_logger
from pisa.db_manager import DBManager from pisa.db_manager import DBManager
from pisa.db_manager import WATCHER_LAST_BLOCK_KEY, RESPONDER_LAST_BLOCK_KEY, LOCATOR_MAP_PREFIX from pisa.db_manager import WATCHER_LAST_BLOCK_KEY, RESPONDER_LAST_BLOCK_KEY, LOCATOR_MAP_PREFIX
@@ -12,8 +11,6 @@ from common.constants import LOCATOR_LEN_BYTES
from test.pisa.unit.conftest import get_random_value_hex, generate_dummy_appointment from test.pisa.unit.conftest import get_random_value_hex, generate_dummy_appointment
c_logger.disabled = True
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def watcher_appointments(): def watcher_appointments():

View File

@@ -1,9 +1,6 @@
from pisa import c_logger
from pisa.encrypted_blob import EncryptedBlob from pisa.encrypted_blob import EncryptedBlob
from test.pisa.unit.conftest import get_random_value_hex from test.pisa.unit.conftest import get_random_value_hex
c_logger.disabled = True
def test_init_encrypted_blob(): def test_init_encrypted_blob():
# No much to test here, basically that the object is properly created # No much to test here, basically that the object is properly created

View File

@@ -4,7 +4,6 @@ from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives import serialization
from pisa import c_logger
from pisa.errors import * from pisa.errors import *
from pisa.inspector import Inspector from pisa.inspector import Inspector
from common.appointment import Appointment from common.appointment import Appointment
@@ -16,7 +15,6 @@ from test.pisa.unit.conftest import get_random_value_hex, generate_dummy_appoint
from common.constants import LOCATOR_LEN_BYTES, LOCATOR_LEN_HEX from common.constants import LOCATOR_LEN_BYTES, LOCATOR_LEN_HEX
from common.cryptographer import Cryptographer from common.cryptographer import Cryptographer
c_logger.disabled = True
inspector = Inspector() inspector = Inspector()
APPOINTMENT_OK = (0, None) APPOINTMENT_OK = (0, None)

View File

@@ -7,7 +7,6 @@ from copy import deepcopy
from threading import Thread from threading import Thread
from queue import Queue, Empty from queue import Queue, Empty
from pisa import c_logger
from pisa.db_manager import DBManager from pisa.db_manager import DBManager
from pisa.responder import Responder, TransactionTracker from pisa.responder import Responder, TransactionTracker
from pisa.block_processor import BlockProcessor from pisa.block_processor import BlockProcessor
@@ -20,8 +19,6 @@ from test.simulator.utils import sha256d
from test.simulator.bitcoind_sim import TX from test.simulator.bitcoind_sim import TX
from test.pisa.unit.conftest import generate_block, generate_blocks, get_random_value_hex from test.pisa.unit.conftest import generate_block, generate_blocks, get_random_value_hex
c_logger.disabled = True
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def responder(db_manager): def responder(db_manager):

View File

@@ -1,10 +1,7 @@
from pisa import c_logger
from pisa.tools import can_connect_to_bitcoind, in_correct_network, bitcoin_cli from pisa.tools import can_connect_to_bitcoind, in_correct_network, bitcoin_cli
from common.tools import check_sha256_hex_format from common.tools import check_sha256_hex_format
c_logger.disabled = True
def test_in_correct_network(run_bitcoind): def test_in_correct_network(run_bitcoind):
# The simulator runs as if it was regtest, so every other network should fail # The simulator runs as if it was regtest, so every other network should fail

View File

@@ -4,7 +4,6 @@ from threading import Thread
from queue import Queue, Empty from queue import Queue, Empty
from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives import serialization
from pisa import c_logger
from pisa.watcher import Watcher from pisa.watcher import Watcher
from pisa.responder import Responder from pisa.responder import Responder
from pisa.tools import bitcoin_cli from pisa.tools import bitcoin_cli
@@ -20,7 +19,6 @@ from pisa.conf import EXPIRY_DELTA, MAX_APPOINTMENTS
from common.tools import check_sha256_hex_format from common.tools import check_sha256_hex_format
from common.cryptographer import Cryptographer from common.cryptographer import Cryptographer
c_logger.disabled = True
APPOINTMENTS = 5 APPOINTMENTS = 5
START_TIME_OFFSET = 1 START_TIME_OFFSET = 1