Skip to content

Commit 187028d

Browse files
authored
Merge pull request #3574 from aloctavodia/travis
use service xvfb
2 parents 6691d7e + edcaf75 commit 187028d

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ addons:
1212

1313
before_install:
1414
- . ./scripts/install_miniconda.sh
15-
- sh -e /etc/init.d/xvfb start
16-
- export DISPLAY=":99.0"
1715
- export MKL_THREADING_LAYER=GNU
1816

17+
services:
18+
- xvfb
19+
1920
install:
2021
- . ./scripts/create_testenv.sh
2122
- pip install coveralls

pymc3/tests/test_distributions_timeseries.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import numpy as np
88
import pytest
9+
from .helpers import select_by_precision
910

1011
pytestmark = pytest.mark.usefixtures('seeded_test')
1112

@@ -92,7 +93,8 @@ def test_GARCH11():
9293
z = Normal('z', mu=0, sigma=vol, shape=data.shape)
9394
garch_like = t['y'].logp({'z':data, 'y': data})
9495
reg_like = t['z'].logp({'z':data, 'y': data})
95-
np.testing.assert_allclose(garch_like, reg_like)
96+
decimal = select_by_precision(float64=7, float32=4)
97+
np.testing.assert_allclose(garch_like, reg_like, 10**(-decimal))
9698

9799

98100

pymc3/tests/test_minibatches.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,14 @@ def test_multidim_scaling(self):
232232
with pm.Model() as model5:
233233
Normal('n', observed=[[1]], total_size=[2, Ellipsis, 2])
234234
p5 = theano.function([], model5.logpt)
235-
assert p0() == p1() == p2() == p3() == p4() == p5()
235+
_p0 = p0()
236+
assert (
237+
np.allclose(_p0, p1()) and
238+
np.allclose(_p0, p2()) and
239+
np.allclose(_p0, p3()) and
240+
np.allclose(_p0, p4()) and
241+
np.allclose(_p0, p5())
242+
)
236243

237244
def test_common_errors(self):
238245
with pm.Model():

0 commit comments

Comments
 (0)