Unittest: how to pass information to TestCase classes?

Discussion in 'Python' started by AK, Oct 26, 2010.

  1. AK

    AK Guest

    Hi, I have a question about unittest: let's say I create a temp dir for
    my tests, then use loadTestsFromNames() to load my tests from packages
    and modules they're in, then use TextTestRunner.run() to run the tests,
    how can I pass information to TestCase instances, e.g. the location of
    the temp dir I created?

    The dir has to be created just once, before any tests run, and then
    multiple packages and multiple modules in them are imported and run.

    Thanks! -ak
     
    AK, Oct 26, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan Decaluwe
    Replies:
    2
    Views:
    321
    Peter Otten
    Mar 2, 2004
  2. Steven Bethard

    unittest.TestCase, lambda and __getitem__

    Steven Bethard, Sep 13, 2004, in forum: Python
    Replies:
    7
    Views:
    459
    Alex Martelli
    Sep 14, 2004
  3. Tom Harris
    Replies:
    1
    Views:
    310
    Diez B. Roggisch
    Nov 27, 2007
  4. Oltmans
    Replies:
    1
    Views:
    848
    Francesco Bochicchio
    Sep 28, 2009
  5. Scott
    Replies:
    1
    Views:
    139
    Timothy Hunter
    Aug 20, 2005
Loading...

Share This Page