public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: /, PMSTestSuite/library/
Date: Sun, 22 May 2011 18:47:22 +0000 (UTC)	[thread overview]
Message-ID: <11d892ea21e75a38e05a44f6b21561c1b0e93df7.mgorny@gentoo> (raw)

commit:     11d892ea21e75a38e05a44f6b21561c1b0e93df7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 18:47:15 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun May 22 18:47:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=11d892ea

Add doctests and a test runner.

---
 PMSTestSuite/library/__init__.py |    3 +++
 run-tests.py                     |   12 ++++++++++++
 test.py                          |    6 ------
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/PMSTestSuite/library/__init__.py b/PMSTestSuite/library/__init__.py
index b1d3262..40db438 100644
--- a/PMSTestSuite/library/__init__.py
+++ b/PMSTestSuite/library/__init__.py
@@ -12,6 +12,9 @@ def load_library(name):
 	subclass found there.
 
 	Returns a new TestLibrary subclass instance or raises an ImportError.
+
+	>>> load_library('test') # doctest: +ELLIPSIS
+	<PMSTestSuite.library.test.ExampleLibrary object at ...>
 	"""
 	# XXX: which exceptions can it raise?
 	

diff --git a/run-tests.py b/run-tests.py
new file mode 100755
index 0000000..9f87ef2
--- /dev/null
+++ b/run-tests.py
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+
+import unittest
+import doctest
+import PMSTestSuite.library
+
+def load_tests(loader, tests, ignore):
+	tests.addTests(doctest.DocTestSuite(PMSTestSuite.library))
+	return tests
+
+if __name__ == '__main__':
+	unittest.main()

diff --git a/test.py b/test.py
deleted file mode 100644
index 05f2c98..0000000
--- a/test.py
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/python
-# A simple PMSTestSuite.library test script.
-
-from PMSTestSuite.library import load_library
-
-print(load_library('test'))



             reply	other threads:[~2011-05-22 18:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 18:47 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-05-25 20:40 [gentoo-commits] proj/pms-test-suite:master commit in: /, PMSTestSuite/library/ Michał Górny
2011-05-25 20:40 Michał Górny
2011-05-26  7:25 Michał Górny
2011-05-31 18:10 Michał Górny

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=11d892ea21e75a38e05a44f6b21561c1b0e93df7.mgorny@gentoo \
    --to=mgorny@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