You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking inside the code (Session.prepareSysPath) it seems that "code-directories" paths are relative to the --top-level-directory. If that's not specified (and it can't seem to be specified from the config file) then it becomes relative to start-dir.
This is non-obvious and confusing (I had to read the code). It should be cleaned up somehow or at least publicly documented.
I tried to write a nose2.cfg like the following:
[unittest]
code-directories = lib/python
start-dir = lib/python/
This looks like a way to test only one module from a directory, but it doesn't actually work. Instead I need to specify code-directories = ../
It would also be nice to warn if a code-directory is not found and won't be added to sys.path.
The text was updated successfully, but these errors were encountered:
What I can remember off the top of my head is that this behavior was based on how unittest2.discover works. That probably means the right fix is documenting the way the various directory settings interact (especially when they are given as relative dirs). Also being able to set --top-level from the config file seems like a thing that should be possible. I don't expect to have time any time soon to look at the code and get a better answer, unfortunately.
Looking inside the code (Session.prepareSysPath) it seems that "code-directories" paths are relative to the --top-level-directory. If that's not specified (and it can't seem to be specified from the config file) then it becomes relative to start-dir.
This is non-obvious and confusing (I had to read the code). It should be cleaned up somehow or at least publicly documented.
I tried to write a nose2.cfg like the following:
[unittest]
code-directories = lib/python
start-dir = lib/python/
This looks like a way to test only one module from a directory, but it doesn't actually work. Instead I need to specify code-directories = ../
It would also be nice to warn if a code-directory is not found and won't be added to sys.path.
The text was updated successfully, but these errors were encountered: