Opened 14 years ago
Last modified 12 years ago
#3101 defect new
trial.test.test_loader.FileTest.test_directory modifies the twisted installation
Reported by: | radix | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | trial | Keywords: | |
Cc: | Thijs Triemstra, spiv | Branch: | |
Author: |
Description
This makes it fail if you're running the tests on a system-installed Twisted.
Change History (5)
comment:1 Changed 13 years ago by
comment:2 Changed 12 years ago by
Cc: | Thijs Triemstra added |
---|
comment:3 Changed 12 years ago by
I recommend the first solution. I think we use it elsewhere in similar situations in the Twisted test suite.
comment:5 Changed 11 years ago by
Owner: | Jonathan Lange deleted |
---|
Note: See
TracTickets for help on using
tickets.
Test_directory wants to test that
runner.filenameToModule(path)
will work identically whether or notpath
has a trailing slash. It seems that for this to work,path
must be an importable Python package or a sub-package of an importable package. The test reasonably assumes it's currently in an importable package, so constructs a temporary package along-side to use for its tests, which causes problems.Potential solutions include:
$PWD
(which should be the writable_trial_temp
directory), mess withsys.path
to make it importable.__file__
which we already know is an importable package, instead of trying to construct a new package at runtime.I'm not sure which would be better, but both seem like they should be fairly easy.