summary refs log tree commit diff
path: root/pkgs/development/python-modules/testtools
diff options
context:
space:
mode:
authorFrederik Rietdijk <freddyrietdijk@fridh.nl>2017-09-05 11:16:41 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2017-09-06 13:54:10 +0200
commit67651d80bc8baaf09ab91fec8ea423e09107ed8f (patch)
tree216a82ca309b80298039c2038160a22e94a1de6f /pkgs/development/python-modules/testtools
parent036bafe0b94fb99ee9d1eb3d2fb902293a9f39a6 (diff)
downloadnixlib-67651d80bc8baaf09ab91fec8ea423e09107ed8f.tar
nixlib-67651d80bc8baaf09ab91fec8ea423e09107ed8f.tar.gz
nixlib-67651d80bc8baaf09ab91fec8ea423e09107ed8f.tar.bz2
nixlib-67651d80bc8baaf09ab91fec8ea423e09107ed8f.tar.lz
nixlib-67651d80bc8baaf09ab91fec8ea423e09107ed8f.tar.xz
nixlib-67651d80bc8baaf09ab91fec8ea423e09107ed8f.tar.zst
nixlib-67651d80bc8baaf09ab91fec8ea423e09107ed8f.zip
Merge pull request #28884 from FRidh/python-fixes
Python: several fixes
Diffstat (limited to 'pkgs/development/python-modules/testtools')
-rw-r--r--pkgs/development/python-modules/testtools/default.nix38
-rw-r--r--pkgs/development/python-modules/testtools/testtools_support_unittest2.patch22
2 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/testtools/default.nix b/pkgs/development/python-modules/testtools/default.nix
new file mode 100644
index 000000000000..d1f3a5feeaaa
--- /dev/null
+++ b/pkgs/development/python-modules/testtools/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pbr
+, python_mimeparse
+, extras
+, lxml
+, unittest2
+, traceback2
+, isPy3k
+}:
+
+buildPythonPackage rec {
+  pname = "testtools";
+  version = "1.8.0";
+  name = "${pname}-${version}";
+
+  # Python 2 only judging from SyntaxError
+#   disabled = isPy3k;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "15yxz8d70iy1b1x6gd7spvblq0mjxjardl4vnaqasxafzc069zca";
+  };
+
+  propagatedBuildInputs = [ pbr python_mimeparse extras lxml unittest2 ];
+  buildInputs = [ traceback2 ];
+  patches = [ ./testtools_support_unittest2.patch ];
+
+  # No tests in archive
+  doCheck = false;
+
+  meta = {
+    description = "A set of extensions to the Python standard library's unit testing framework";
+    homepage = http://pypi.python.org/pypi/testtools;
+    license = lib.licenses.mit;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/testtools/testtools_support_unittest2.patch b/pkgs/development/python-modules/testtools/testtools_support_unittest2.patch
new file mode 100644
index 000000000000..545e5f01ec09
--- /dev/null
+++ b/pkgs/development/python-modules/testtools/testtools_support_unittest2.patch
@@ -0,0 +1,22 @@
+From e600d12980ccb807ba1ca3fb6a4da1d0b89c02f6 Mon Sep 17 00:00:00 2001
+From: Robert Collins <robertc@robertcollins.net>
+Date: Wed, 1 Jul 2015 15:46:28 +1200
+Subject: [PATCH] Fix tests with unittest2 1.1.0 and higher.
+
+Change-Id: I4613d47852fbf901819f197f6e388ccaa717b53e
+---
+ testtools/tests/test_run.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testtools/tests/test_run.py b/testtools/tests/test_run.py
+index ead716b..433b6f8 100644
+--- a/testtools/tests/test_run.py
++++ b/testtools/tests/test_run.py
+@@ -201,6 +201,7 @@ def test_run_list_failed_import(self):
+             run.main, ['prog', 'discover', '-l', broken.package.base, '*.py'], out)
+         self.assertEqual(2, exc.args[0])
+         self.assertThat(out.getvalue(), DocTestMatches("""\
++unittest2.loader._FailedTest.runexample
+ Failed to import test module: runexample
+ Traceback (most recent call last):
+   File ".../loader.py", line ..., in _find_test_path