def test_loadlist(self): (cmd, tmpf) = expand_command_run("test $LOADLIST", True, False, subtests=["foo", "bar"]) self.addCleanup(os.remove, tmpf) f = open(tmpf, 'r') try: self.assertEquals(f.read(), "foo\nbar\n") finally: f.close() self.assertEquals("test --load-list=%s" % tmpf, cmd)
def test_loadlist(self): (cmd, tmpf) = expand_command_run("test $LOADLIST", True, False, subtests=["foo", "bar"]) self.addCleanup(os.remove, tmpf) f = open(tmpf, 'r') try: self.assertEquals(f.read(), "foo\nbar\n") finally: f.close() self.assertEquals("test --load-list={0!s}".format(tmpf), cmd)
for (name, envname, cmd, supports_loadfile, supports_idlist, subtests) in todo: try: env = switch_env(envname, prefix) except UnsupportedEnvironment: subunit_ops.start_testsuite(name) subunit_ops.end_testsuite(name, "skip", "environment %s is unknown in this test backend - skipping" % envname) continue except Exception, e: subunit_ops.start_testsuite(name) traceback.print_exc() subunit_ops.end_testsuite(name, "error", "unable to set up environment %s: %s" % (envname, e)) continue cmd, tmpf = expand_command_run(cmd, supports_loadfile, supports_idlist, subtests) run_testsuite(name, cmd, subunit_ops, env=env) if tmpf is not None: os.remove(tmpf) if opts.resetup_environment: env_manager.teardown_env(envname) env_manager.teardown_all() sys.stdout.write("\n") # if there were any valgrind failures, show them for fn in os.listdir(prefix): if fn.startswith("valgrind.log"):
def test_loadlist_all(self): self.assertEquals(("test ", None), expand_command_run("test $LOADLIST", True, False))
def test_idlist_all(self): self.assertEquals(("test", None), expand_command_run("test", False, True))
def test_idlist(self): self.assertEquals(("test foo bar", None), expand_command_run("test", False, True, subtests=["foo", "bar"]))