From the patch:
>-test_no_trailing_whitespace_and_no_tabs()
>+ # go to the root directory (where setup.py is)
>+ path = path + sep + pardir + sep + pardir + sep + pardir
>+ sympy_root = abspath(path)
>+ check_directory_tree(sympy_root)
This might be a bad idea: what if you want to run the tests *after*
installation?
I think putting the code-quality tests into sympy/utilities/tests was a bad
idea. I should have chosen bin/.
Thanks for noticing. Well I think the tests are not copied by
"setup.py install", are they?
So you probably mean just copying the sympy dir by hand, right?
> I think putting the code-quality tests into sympy/utilities/tests was a bad
> idea. I should have chosen bin/.
Let's move it, no problem. However moving it to bin, it won't be
executed by py.tests, as they test the sympy/ dir only, so
I suggest to leave it in utilities, but only test files in the sympy/ dir.
And create another one (in bin/ dir) that will test examples +
setup.py and this will be run by hand on each release. What do you
think?
Ondrej
Unfortunately, they are.
At least the ones in sympy/, but not the ones in bin/. So tests in bin/ are
only executed before installation, which is exactly what we want.
> So you probably mean just copying the sympy dir by hand, right?
>
> > I think putting the code-quality tests into sympy/utilities/tests was a
> > bad idea. I should have chosen bin/.
>
> Let's move it, no problem. However moving it to bin, it won't be
> executed by py.tests, as they test the sympy/ dir only, so
> I suggest to leave it in utilities, but only test files in the sympy/ dir.
> And create another one (in bin/ dir) that will test examples +
> setup.py and this will be run by hand on each release. What do you
> think?
I tried it: py.test does execute tests in bin/. So there should not be a
problem.
By the way, you are suggesting to have two files for one thing, an idea I do
not like much.
Felix
I think that is a good idea. From the Zen of Python:
"Special cases aren't special enough to break the rules."
If its not a test module, don't make it look like one. Makes our lives easier.
> >
> > > By the way, you are suggesting to have two files for one thing, an idea
> > > I do not like much.
> >
> > That I don't like either. But imho here it is not the same thing ---
> > all tests in the sympy/ dir should be self contained and only test
> > things in that dir.
> > Plus we have some Q&A tests outside of the sympy/ dir, for example bin/
> > test_import.py, bin/test_pure etc. So imho it's ok to add more tests,
> > like for the setup.py.
>
> What is the state of this -- is it ok to commit, or shall the patch be
> reworked (in which case, how should we fix the problem?)?
>
> Ondrej
I think its best to put quality assurance tests in bin/, so that they won't
get installed. They are not really "features" of sympy.
Also see my comments on #852.
Sorry for delay, by the way.
Felix