1 |
commit: dcbbaf9400b095f3066f3104906b031cd79e203d |
2 |
Author: Aisha Tammy <gentoo <AT> aisha <DOT> cc> |
3 |
AuthorDate: Wed Dec 30 19:19:44 2020 +0000 |
4 |
Commit: Aisha Tammy <gentoo <AT> aisha <DOT> cc> |
5 |
CommitDate: Wed Dec 30 19:19:44 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=dcbbaf94 |
7 |
|
8 |
dev-python/bz2file: add and fix tests |
9 |
|
10 |
Package-Manager: Portage-3.0.12, Repoman-3.0.2 |
11 |
Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc> |
12 |
|
13 |
dev-python/bz2file/bz2file-0.98.ebuild | 6 ++++++ |
14 |
.../files/bz2file-0.98-always-threading.patch | 22 ++++++++++++++++++++++ |
15 |
2 files changed, 28 insertions(+) |
16 |
|
17 |
diff --git a/dev-python/bz2file/bz2file-0.98.ebuild b/dev-python/bz2file/bz2file-0.98.ebuild |
18 |
index 0021a9536..0324854a1 100644 |
19 |
--- a/dev-python/bz2file/bz2file-0.98.ebuild |
20 |
+++ b/dev-python/bz2file/bz2file-0.98.ebuild |
21 |
@@ -15,3 +15,9 @@ LICENSE="Apache-2.0" |
22 |
SLOT="0" |
23 |
KEYWORDS="~amd64 ~x86" |
24 |
|
25 |
+PATCHES=( "${FILESDIR}"/${P}-always-threading.patch ) |
26 |
+ |
27 |
+python_test() { |
28 |
+ distutils_install_for_testing |
29 |
+ ${EPYTHON} test_bz2file.py || die "tests failed for ${EPYTHON}" |
30 |
+} |
31 |
|
32 |
diff --git a/dev-python/bz2file/files/bz2file-0.98-always-threading.patch b/dev-python/bz2file/files/bz2file-0.98-always-threading.patch |
33 |
new file mode 100644 |
34 |
index 000000000..ec11bce25 |
35 |
--- /dev/null |
36 |
+++ b/dev-python/bz2file/files/bz2file-0.98-always-threading.patch |
37 |
@@ -0,0 +1,22 @@ |
38 |
+threading is always available in newer pythons |
39 |
+ |
40 |
+https://github.com/nvawda/bz2file/issues/7 |
41 |
+ |
42 |
+--- a/test_bz2file.py |
43 |
++++ b/test_bz2file.py |
44 |
+@@ -496,15 +496,6 @@ class BZ2FileTest(BaseTest): |
45 |
+ for t in threads: |
46 |
+ t.join() |
47 |
+ |
48 |
+- def testWithoutThreading(self): |
49 |
+- if not hasattr(support, "import_fresh_module"): |
50 |
+- return |
51 |
+- module = support.import_fresh_module("bz2file", blocked=("threading",)) |
52 |
+- with module.BZ2File(self.filename, "wb") as f: |
53 |
+- f.write(b"abc") |
54 |
+- with module.BZ2File(self.filename, "rb") as f: |
55 |
+- self.assertEqual(f.read(), b"abc") |
56 |
+- |
57 |
+ def testMixedIterationAndReads(self): |
58 |
+ self.createTempFile() |
59 |
+ linelen = len(self.TEXT_LINES[0]) |