fix tests - add matplotlib to setup_requires, put mpi4py import in try-except

This commit is contained in:
Peter Zhokhov
2019-05-03 16:29:10 -07:00
parent 46fa1b6453
commit 75200671c4
2 changed files with 8 additions and 3 deletions

View File

@@ -1,7 +1,11 @@
from baselines.common import mpi_util
from mpi4py import MPI
from baselines import logger
from baselines.common.tests.test_with_mpi import with_mpi
try:
from mpi4py import MPI
except ImportError:
MPI = None
@with_mpi()
def test_mpi_weighted_mean():
@@ -23,4 +27,4 @@ def test_mpi_weighted_mean():
logger.logkv_mean(name, val)
d2 = logger.dumpkvs()
if comm.rank == 0:
assert d2 == correctval
assert d2 == correctval

View File

@@ -12,7 +12,8 @@ extras = {
'filelock',
'pytest',
'pytest-forked',
'atari-py'
'atari-py',
'matplotlib',
],
'mpi': [
'mpi4py'