Can we move the tests folder inside the pylons folder?

2 views
Skip to first unread message

Matt Wilson

unread,
Nov 18, 2008, 11:00:45 AM11/18/08
to pylons-discuss
After easy_installing Pylons, my site-packages folder has an easy-
install.pth file that points to my Pylons-0.9.7....egg folder.

Inside that egg folder, I've got these directories:

$ ls ~/virtualenvs/scratch/lib/python2.5/site-packages/Pylons-0.9.7rc3-
py2.5.egg/
EGG-INFO pylons tests

See that tests directory? As far as I can tell, the combination of
the lines in easy-install.pth and that tests directory mean that
whenever I run import tests, I get this particular tests module,
rather than the tests folder in the current directory.

This is problematic for me because it is masking other tests modules
that also want to hog the top level.

TurboGears holds its tests directory inside its turbogears package.
Should Pylons do something similar?

I'm suggesting that somebody with svn commit powers does:

$ svn mv tests pylons/

And then hopefully this problem would go away.

Maybe a completely different solution could be to not even install the
tests into site-packages.

Thoughts?

Matt

Ian Bicking

unread,
Nov 18, 2008, 12:51:32 PM11/18/08
to pylons-...@googlegroups.com
Matt Wilson wrote:
> After easy_installing Pylons, my site-packages folder has an easy-
> install.pth file that points to my Pylons-0.9.7....egg folder.
>
> Inside that egg folder, I've got these directories:
>
> $ ls ~/virtualenvs/scratch/lib/python2.5/site-packages/Pylons-0.9.7rc3-
> py2.5.egg/
> EGG-INFO pylons tests

Hrm... the reason I typically put tests outside of the package is to
skip installing them. Should Pylons just not install that package?


--
Ian Bicking : ia...@colorstudy.com : http://blog.ianbicking.org

Matt Wilson

unread,
Nov 18, 2008, 5:02:36 PM11/18/08
to pylons-discuss
On Nov 18, 12:51 pm, Ian Bicking <i...@colorstudy.com> wrote:
> Matt Wilson wrote:
> > After easy_installing Pylons, my site-packages folder has an easy-
> > install.pth file that points to my Pylons-0.9.7....egg folder.
>
> > Inside that egg folder, I've got these directories:
>
> > $ ls ~/virtualenvs/scratch/lib/python2.5/site-packages/Pylons-0.9.7rc3-
> > py2.5.egg/
> > EGG-INFO  pylons  tests
>
> Hrm... the reason I typically put tests outside of the package is to
> skip installing them.  Should Pylons just not install that package?

What is the downside of installing tests underneath pylons? It might
be better to have the tests and not need them instead of the other way
around.

Mike Orr

unread,
Nov 18, 2008, 5:46:32 PM11/18/08
to pylons-...@googlegroups.com

The downside of course is disk space. (And on App Engine, the 1000-file limit.)

I don't think a best practice has emerged on where to put the tests,
because some people put them inside the package and others outside.
My inclination would be to put them inside, because a top-level
'tests' is rather presumptive. ("This is the most important package
in the world, and no other package would have tests.")

--
Mike Orr <slugg...@gmail.com>

Ian Bicking

unread,
Nov 18, 2008, 5:51:57 PM11/18/08
to pylons-...@googlegroups.com

Well, with py.test it didn't care about __init__.py, so it wouldn't be a
test at all. But then with Python 2.6 that isn't enough to keep it from
being a package, and nose cared about importability so a lot of them
have __init__.py... which messes it up. But still that tests/ directory
should never be installed if it is top-level.

Reply all
Reply to author
Forward
0 new messages