aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAisha Tammy <gentoo@aisha.cc>2020-12-30 19:19:44 +0000
committerAisha Tammy <gentoo@aisha.cc>2020-12-30 19:19:44 +0000
commitdcbbaf9400b095f3066f3104906b031cd79e203d (patch)
tree376b593e8e6e0ce72b359e022f241beb371528eb /dev-python
parentsci-biology/khmer: version bump 2.1.1 (diff)
downloadsci-dcbbaf9400b095f3066f3104906b031cd79e203d.tar.gz
sci-dcbbaf9400b095f3066f3104906b031cd79e203d.tar.bz2
sci-dcbbaf9400b095f3066f3104906b031cd79e203d.zip
dev-python/bz2file: add and fix tests
Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Aisha Tammy <gentoo@aisha.cc>
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/bz2file/bz2file-0.98.ebuild6
-rw-r--r--dev-python/bz2file/files/bz2file-0.98-always-threading.patch22
2 files changed, 28 insertions, 0 deletions
diff --git a/dev-python/bz2file/bz2file-0.98.ebuild b/dev-python/bz2file/bz2file-0.98.ebuild
index 0021a9536..0324854a1 100644
--- a/dev-python/bz2file/bz2file-0.98.ebuild
+++ b/dev-python/bz2file/bz2file-0.98.ebuild
@@ -15,3 +15,9 @@ LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
+PATCHES=( "${FILESDIR}"/${P}-always-threading.patch )
+
+python_test() {
+ distutils_install_for_testing
+ ${EPYTHON} test_bz2file.py || die "tests failed for ${EPYTHON}"
+}
diff --git a/dev-python/bz2file/files/bz2file-0.98-always-threading.patch b/dev-python/bz2file/files/bz2file-0.98-always-threading.patch
new file mode 100644
index 000000000..ec11bce25
--- /dev/null
+++ b/dev-python/bz2file/files/bz2file-0.98-always-threading.patch
@@ -0,0 +1,22 @@
+threading is always available in newer pythons
+
+https://github.com/nvawda/bz2file/issues/7
+
+--- a/test_bz2file.py
++++ b/test_bz2file.py
+@@ -496,15 +496,6 @@ class BZ2FileTest(BaseTest):
+ for t in threads:
+ t.join()
+
+- def testWithoutThreading(self):
+- if not hasattr(support, "import_fresh_module"):
+- return
+- module = support.import_fresh_module("bz2file", blocked=("threading",))
+- with module.BZ2File(self.filename, "wb") as f:
+- f.write(b"abc")
+- with module.BZ2File(self.filename, "rb") as f:
+- self.assertEqual(f.read(), b"abc")
+-
+ def testMixedIterationAndReads(self):
+ self.createTempFile()
+ linelen = len(self.TEXT_LINES[0])