public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: tests/
Date: Sat, 23 Aug 2014 19:03:06 +0000 (UTC)	[thread overview]
Message-ID: <1408820335.14ce917c1ff12f93894adcd6712a00ca5331e12a.dywi@gentoo> (raw)

commit:     14ce917c1ff12f93894adcd6712a00ca5331e12a
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Sat Aug 23 18:58:55 2014 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Sat Aug 23 18:58:55 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=14ce917c

tests/depres.py: print test data identifier

Helps when tests fail.

---
 tests/depres.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/depres.py b/tests/depres.py
index 77a6857..238731c 100644
--- a/tests/depres.py
+++ b/tests/depres.py
@@ -61,7 +61,7 @@ class DepresTestCase ( tests.interface.RoverlayInterfaceTestCase ):
       self.depres.update()
    # --- end of tearDown (...) ---
 
-   def do_depres_test ( self, rule_names, test_data ):
+   def do_depres_test ( self, test_identifier, rule_names, test_data ):
       unpacked = lambda T: \
          ( "" if T[0] is None else T[0] ) if T and len ( T ) == 1 else T
 
@@ -81,21 +81,21 @@ class DepresTestCase ( tests.interface.RoverlayInterfaceTestCase ):
 
          self.assertEquals (
             result, expected_result,
-            "{!r} should be resolved as {!r} and not {!r}".format (
-               depstr, expected_result, result
+            "{!s}: {!r} should be resolved as {!r} and not {!r}".format (
+               test_identifier, depstr, expected_result, result
             )
          )
    # --- end of do_depres_test (...) ---
 
    def do_randomized_depres_test (
-      self, rule_names, test_data, allow_modify=False
+      self, test_identifier, rule_names, test_data, allow_modify=False
    ):
       if allow_modify and isinstance ( test_data, list ):
          rand_list = test_data
       else:
          rand_list = list ( test_data )
       random.shuffle ( rand_list )
-      return self.do_depres_test ( rule_names, rand_list )
+      return self.do_depres_test ( test_identifier, rule_names, rand_list )
    # --- end of do_randomized_depres_test (...) ---
 
    def get_depres_include ( self, dataset_name ):
@@ -140,6 +140,7 @@ class DepresTestCase ( tests.interface.RoverlayInterfaceTestCase ):
    def test_depres_static ( self ):
       for name, test_data in DEPRES_DATA.items():
          self.do_depres_test (
+            name,
             self.get_depres_include ( name ),
             DEPRES_DATA [test_data] if isinstance ( test_data, str )
                else test_data
@@ -153,6 +154,7 @@ class DepresTestCase ( tests.interface.RoverlayInterfaceTestCase ):
       for name in data_keys:
          test_data = DEPRES_DATA [name]
          self.do_randomized_depres_test (
+            name,
             self.get_depres_include ( name ),
             DEPRES_DATA [test_data] if isinstance ( test_data, str )
                else test_data


             reply	other threads:[~2014-08-23 19:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-23 19:03 André Erdmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-08-20 21:46 [gentoo-commits] proj/R_overlay:master commit in: tests/ André Erdmann
2013-08-05 11:44 André Erdmann
2013-07-03 10:05 André Erdmann

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=1408820335.14ce917c1ff12f93894adcd6712a00ca5331e12a.dywi@gentoo \
    --to=dywi@mailerd.de \
    --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