setup and teardown for all tests in a directory

Bug #819427 reported by Michael Foord
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
selenium-simple-test
Triaged
Low
Unassigned

Bug Description

If a directory contains a setup and a teardown script then these should be executed around all tests in that directory.

Should the setup / teardown of parent directories also be executed? Not for the initial implementation I guess.

Revision history for this message
Leo Arias (elopio) wrote :

I would really like this.
I suggest that if a setup and teardown is in the shared folder, it should be executed first, and for all the tests.
And then, all setup and teardown scripts in the hierarchy of a tests should be executed in order (descending for setup, ascending for tear down)

Changed in selenium-simple-test:
status: New → Confirmed
Revision history for this message
Darren Worrall (dazworrall) wrote :

I've pushed a quick stab at this - it doesnt run the setup/teardown of parent directories at the moment. I wasnt sure how best to test the teardown, hence running the same test twice (a/b). Mr Foord might have a suggestion here.

I should really set the patch of the 'anchor' file absolutely, but __file__ isnt available in the tests for some reason.

Revision history for this message
Michael Foord (mfoord) wrote :

I like the feature but haven't reviewed the patch yet. Most of the following points are probably already covered in the patch:

* It will need doc updates
* The setup / teardown must be run in the same execution context as the test
* It must play well with the csv feature (should do by default)
* On instinct I dislike the mixed casing of setUp.py but using setup.py clashes with the established meaning of that filename
* The setup and teardown files must not be recognised as tests

Having a setup and teardown heirarchy, including allowing it in shared directory, would be *nice* - but isn't a requirement for an initial implementation.

Revision history for this message
Michael Foord (mfoord) wrote :

And if __file__ isn't available in the test execution context I would treat that as a bug (I thought it was).

Changed in selenium-simple-test:
status: Confirmed → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.