aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2017-11-03 11:48:36 +0000
committerArmin Kuster <akuster808@gmail.com>2017-11-09 12:46:28 -0800
commit85b39219d203dcdd83157fb14be8725d7fc2b0eb (patch)
tree648ebb335bc162094f11ccf62a9457bce6791278
parent2dba56602b1470c7be3c1d003c511a90e653ea18 (diff)
downloadbitbake-contrib-85b39219d203dcdd83157fb14be8725d7fc2b0eb.tar.gz
tests/fetch: use subtests in the wget tests
As we test multiple URLs in this these tests and one failing abandons the test, use subtests so all URLs are tested. This should help us identify patterns in the failing URLs. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c4c4465b32e82d4b6e46a44e776be5039aef6b18) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--lib/bb/tests/fetch.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index f1799a7ef..b07bf0047 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -848,10 +848,11 @@ class FetchCheckStatusTest(FetcherTest):
def test_wget_checkstatus(self):
fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d)
for u in self.test_wget_uris:
- ud = fetch.ud[u]
- m = ud.method
- ret = m.checkstatus(fetch, ud, self.d)
- self.assertTrue(ret, msg="URI %s, can't check status" % (u))
+ with self.subTest(url=u):
+ ud = fetch.ud[u]
+ m = ud.method
+ ret = m.checkstatus(fetch, ud, self.d)
+ self.assertTrue(ret, msg="URI %s, can't check status" % (u))
@skipIfNoNetwork()
def test_wget_checkstatus_connection_cache(self):
@@ -862,10 +863,11 @@ class FetchCheckStatusTest(FetcherTest):
connection_cache = connection_cache)
for u in self.test_wget_uris:
- ud = fetch.ud[u]
- m = ud.method
- ret = m.checkstatus(fetch, ud, self.d)
- self.assertTrue(ret, msg="URI %s, can't check status" % (u))
+ with self.subTest(url=u):
+ ud = fetch.ud[u]
+ m = ud.method
+ ret = m.checkstatus(fetch, ud, self.d)
+ self.assertTrue(ret, msg="URI %s, can't check status" % (u))
connection_cache.close_connections()