[qmtest] Finding test location

Vladimir Prus ghost at cs.msu.su
Thu Mar 28 09:33:57 UTC 2002


Mark Mitchell wrote:
> > How can this question be addressed? Is it assumed that the location of
> > the  test database be always passed as context variable?
>
> That would work.
>
> The basic model assumes that tests may not be stored in the file system,
> so it doesn't make sense to have a way of getting the path to the test.

But the test database itself has a location in file system. Why don't make it 
available to tests? Finding it using "id" and current working directory is a 
little bit elaborated.

> You can, however, get it's test id, with the "id" argument.  (So,
> from Python, in the 'Run' method, you can do:
>
>   self.id
>
> ).  The XML test database also sets the working directory for the test
> execution to the directory containg the file, so you can find yourself
> by putting those two pieces of information together.
>
> Does that make sense?

Thanks for this information.

What do you think about sys.path for python.ExecTest? Isn't expecting 
dir_path/QMTest there a reasonable expectation? I've actually wrote a test 
class that can add it there, but the need to extend QMTest for this simple 
task somewhat bothers me.

- Volodya



More information about the qmtest mailing list