public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/process/
Date: Mon, 29 Aug 2011 04:00:05 +0000 (UTC)	[thread overview]
Message-ID: <b76d113b6c23fdcb4dcbf8084e7e3773448d0ff5.zmedico@gentoo> (raw)

commit:     b76d113b6c23fdcb4dcbf8084e7e3773448d0ff5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 29 03:59:26 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 29 03:59:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b76d113b

test_poll: fix "ResourceWarning: unclosed file"

---
 pym/portage/tests/process/test_poll.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/process/test_poll.py b/pym/portage/tests/process/test_poll.py
index ee6ee0c..c3b50d4 100644
--- a/pym/portage/tests/process/test_poll.py
+++ b/pym/portage/tests/process/test_poll.py
@@ -34,6 +34,14 @@ class PipeReaderTestCase(TestCase):
 			scheduler=scheduler)
 
 		consumer.start()
-		consumer.wait()
+
+		# This will ensure that both tasks have exited, which
+		# is necessary to avoid "ResourceWarning: unclosed file"
+		# warnings since Python 3.2 (and also ensures that we
+		# don't leave any zombie child processes).
+		scheduler.schedule()
+		self.assertEqual(producer.returncode, os.EX_OK)
+		self.assertEqual(consumer.returncode, os.EX_OK)
+
 		output = consumer.getvalue().decode('ascii', 'replace')
 		self.assertEqual(test_string, output)



             reply	other threads:[~2011-08-29  4:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29  4:00 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-12-16 22:26 [gentoo-commits] proj/portage:master commit in: pym/portage/tests/process/ Zac Medico
2011-12-18 21:28 Zac Medico
2011-12-18 21:47 Zac Medico
2012-02-09  3:51 Zac Medico
2012-10-16 19:41 Zac Medico
2012-10-19  2:18 Zac Medico
2013-09-02 22:18 Zac Medico
2018-05-26 10:47 Zac Medico
2018-05-26 22:41 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b76d113b6c23fdcb4dcbf8084e7e3773448d0ff5.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox