summaryrefslogtreecommitdiff
path: root/examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/wrappers_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/wrappers_test.py')
-rw-r--r--examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/wrappers_test.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/wrappers_test.py b/examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/wrappers_test.py
index dfc6fb263..fac8dd0d4 100644
--- a/examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/wrappers_test.py
+++ b/examples/pybullet/gym/pybullet_envs/minitaur/agents/tools/wrappers_test.py
@@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
"""Tests for environment wrappers."""
from __future__ import absolute_import
@@ -28,18 +27,20 @@ from agents import tools
class ExternalProcessTest(tf.test.TestCase):
def test_close_no_hang_after_init(self):
- constructor = functools.partial(
- tools.MockEnvironment,
- observ_shape=(2, 3), action_shape=(2,),
- min_duration=2, max_duration=2)
+ constructor = functools.partial(tools.MockEnvironment,
+ observ_shape=(2, 3),
+ action_shape=(2,),
+ min_duration=2,
+ max_duration=2)
env = tools.wrappers.ExternalProcess(constructor)
env.close()
def test_close_no_hang_after_step(self):
- constructor = functools.partial(
- tools.MockEnvironment,
- observ_shape=(2, 3), action_shape=(2,),
- min_duration=5, max_duration=5)
+ constructor = functools.partial(tools.MockEnvironment,
+ observ_shape=(2, 3),
+ action_shape=(2,),
+ min_duration=5,
+ max_duration=5)
env = tools.wrappers.ExternalProcess(constructor)
env.reset()
env.step(env.action_space.sample())
@@ -53,8 +54,7 @@ class ExternalProcessTest(tf.test.TestCase):
env.step(env.action_space.sample())
def test_reraise_exception_in_step(self):
- constructor = functools.partial(
- MockEnvironmentCrashInStep, crash_at_step=3)
+ constructor = functools.partial(MockEnvironmentCrashInStep, crash_at_step=3)
env = tools.wrappers.ExternalProcess(constructor)
env.reset()
env.step(env.action_space.sample())
@@ -74,9 +74,10 @@ class MockEnvironmentCrashInStep(tools.MockEnvironment):
"""Raise an error after specified number of steps in an episode."""
def __init__(self, crash_at_step):
- super(MockEnvironmentCrashInStep, self).__init__(
- observ_shape=(2, 3), action_shape=(2,),
- min_duration=crash_at_step + 1, max_duration=crash_at_step + 1)
+ super(MockEnvironmentCrashInStep, self).__init__(observ_shape=(2, 3),
+ action_shape=(2,),
+ min_duration=crash_at_step + 1,
+ max_duration=crash_at_step + 1)
self._crash_at_step = crash_at_step
def step(self, *args, **kwargs):