[tor-bugs] #14944 [Stem]: Allow just a single test to be run

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Feb 27 19:11:30 UTC 2015


#14944: Allow just a single test to be run
-----------------------------+---------------------------
     Reporter:  atagar       |      Owner:  atagar
         Type:  enhancement  |     Status:  new
     Priority:  minor        |  Milestone:
    Component:  Stem         |    Version:
   Resolution:               |   Keywords:  testing, easy
Actual Points:               |  Parent ID:
       Points:               |
-----------------------------+---------------------------

Comment (by clv):

 Hi!

 I was taking a look at this and I have a few thoughts:

  * There will be necessary to change the current test loading method
 (`loadTestsFromTestCase`) since it needs a valid class to run, and a
 method will not satisfy that.
  * The test loading method I suggest is `loadTestsFromName`
 ([https://docs.python.org/3/library/unittest.html#loading-and-running-
 tests doc]) which needs a string pointing to what we want to test, and
 that will be perfect for testing single methods.
  * With this approach it won't be necessary to dynamically load modules
 with !__import!__, since that is handled by `loadTestsFromName` itself ;)

 I've implemented all of the above and I'll reply with the suggested code
 ASAP!

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/14944#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list