I am running the Travis script here: pyDcop/.travis.yml at master · rpgoldman/pyDcop · GitHub
I am trying to debug a problem which is that the tests all pass in Travis, but not locally (I know! The reverse of the usual problem.)
So what I tried to do was to turn on python logging in a particular test, in order to compare input to a function that breaks locally, but works remotely (see test source):
def test_api_distribute_dsa_ilp_fgdp():
import logging
logger = logging.getLogger('distribution.ilpfgdp')
logger.setLevel(logging.DEBUG)
from pydcop.computations_graph import factor_graph
from pydcop.distribution import ilp_fgdp
from pydcop.algorithms import dsa
dcop = dcop_graphcoloring_3()
agents = create_agents('a', range(1, 4), capacity=100)
dcop._agents_def = agents
cg = factor_graph.build_computation_graph(dcop)
dist = ilp_fgdp.distribute(cg, dcop.agents.values(),
computation_memory=dsa.computation_memory,
communication_load=dsa.communication_load)
assert dist.is_hosted(['v1', 'v2', 'v3'])
When I run this locally, I see near the bottom of pytest
output:
---------------------------------------------------------- Captured log call -----------------------------------------------------------
ilp_fgdp.py 97 DEBUG Must host: defaultdict(<function distribute.<locals>.<lambda> at 0x1051f4b80>, {'a1': ['v1', 'v2', 'v3', 'cost_1', 'cost_2', 'cost_3', 'c1', 'c2'], 'a2': ['v1', 'v2', 'v3', 'cost_1', 'cost_2', 'cost_3', 'c1', 'c2'], 'a3': ['v1', 'v2', 'v3', 'cost_1', 'cost_2', 'cost_3', 'c1', 'c2']})
But when I look at the logs on travis, there’s no transcript of captured log calls.
Is there some way to get this information into the travis logs?
Unfortunately, when I do this, and look at the travis log files, there is no output from pytest
. Does travis do something to swallow the output of the python logger