Skip to content

Commit

Permalink
Fix empy stdout proxy logic for unit tests
Browse files Browse the repository at this point in the history
When the test runner changes std out for logging it breaks empy's stdout proxy logic.
Fixes #9
  • Loading branch information
tfoote committed Jan 30, 2019
1 parent 8246052 commit 0671e14
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/test_nvidia.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import unittest
import pexpect

import em

from io import BytesIO as StringIO

Expand All @@ -38,7 +39,17 @@ def setUpClass(self):
self.dockerfile_tag = 'rocker_test_glmark2'
iof = StringIO(dockerfile.encode())
im = client.images.build(fileobj = iof, tag=self.dockerfile_tag)


def setUp(self):
# Work around interference between empy Interpreter
# stdout proxy and test runner. empy installs a proxy on stdout
# to be able to capture the information.
# And the test runner creates a new stdout object for each test.
# This breaks empy as it assumes that the proxy has persistent
# between instances of the Interpreter class
# empy will error with the exception
# "em.Error: interpreter stdout proxy lost"
em.Interpreter._wasProxyInstalled = False

def test_no_nvidia_glmark2(self):
dig = DockerImageGenerator([], [], self.dockerfile_tag)
Expand Down

0 comments on commit 0671e14

Please sign in to comment.