##################################
# helpers
-def powerset(*sets):
- return itertools.chain.from_iterable(
- combinations(sets, r)
- for r in range(len(sets)+1))
-
-
def _captured_script(script):
r, w = os.pipe()
indented = script.replace('\n', '\n ')
interpreters.run_string(id, source, shared)
-def run_interp_threaded(id, source, **shared):
- def run():
- _run(id, source, shared)
- t = threading.Thread(target=run)
- t.start()
- t.join()
-
-
class Interpreter(namedtuple('Interpreter', 'name id')):
@classmethod
self._fs.close()
super().tearDown()
- @property
- def fs(self):
- if self._fs is None:
- self._fs = FSFixture(self)
- return self._fs
-
def test_success(self):
script, file = _captured_script('print("it worked!", end="")')
with file: