user897305
user897305

Reputation:

Running a method just once at the beginning before any tests are run in PyUnit

Im using PyUnit to write unit tests for my code. The setup method is called everytime before any test is run. Is there a way i can define a method that will be run just once at the beginning before any tests are run ?

Please Help Thank You

Upvotes: 6

Views: 997

Answers (2)

Cito
Cito

Reputation: 5613

You can use setUpClass or setUpModule in Python 2.7 and 3.2.

Upvotes: 4

daniel kullmann
daniel kullmann

Reputation: 14023

How about using the constructor of your test class?

Upvotes: 0

Related Questions