<p dir="ltr"><br>
On Oct 6, 2015 3:17 AM, "Paul Moore" <<a href="mailto:p.f.moore@gmail.com">p.f.moore@gmail.com</a>> wrote:<br>
><br>
> On 6 October 2015 at 08:51, Antoine Pitrou <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br>
> > They should be inside the module. That way, you can check an installed<br>
> > module is ok by running e.g. "python -m mypackage.tests". Any other<br>
> > choice makes testing installed modules more cumbersome.<br>
><br>
> One inconvenience with this is that if you use an external testing<br>
> framework like nose or pytest, you either need to make your project<br>
> depend on it, or you need to document that "python -m mypackage.tests"<br>
> has additional dependencies that are not installed by default.<br>
><br>
> With an external tests directory, the testing framework is just<br>
> another "development requirement".<br>
><br>
> It's only a minor point, conceded.</p>
<p dir="ltr">otherwise try/except imports</p>
<p dir="ltr">- [ ] @skipif in stdlib would be helpful</p>
<p dir="ltr">><br>
> > The PyP"A" should definitely fix its sample project to reflect good<br>
> > practices.<br>
><br>
> +1 on the sample project following recommended guidelines. When I<br>
> originally wrote that project, the consensus (such as it was) was in<br>
> favour of tests outside the installed project. But that may have<br>
> simply reflected the group of people who responded at the time. It<br>
> does however have the advantage that it's consistent with how other<br>
> PyPA projects like pip and virtualenv structure their tests.</p>
<p dir="ltr">many of these cookiecutter Python project templates also define e.g. tox.ini and .travis.yml:<br>
<a href="https://github.com/audreyr/cookiecutter-pypackage/blob/master/README.rst#similar-cookiecutter-templates">https://github.com/audreyr/cookiecutter-pypackage/blob/master/README.rst#similar-cookiecutter-templates</a></p>
<p dir="ltr">><br>
> The big problem is that I don't think there *is* a consensus on best<br>
> practice. Both options have their supporters.<br>
><br>
> It would also be very easy to take the view that the PyPA sample<br>
> project should omit the test directory altogether, as it's a sample<br>
> for the *packaging* guide, and development processes like testing are<br>
> out of scope (that's why we don't include a documentation directory,<br>
> or recommend sphinx, for example). Personally, I think if we go to<br>
> that extreme, the sample project becomes useless as a "real world"<br>
> template, but maybe people wanting a starter project template should<br>
> be directed to projects such as cookiecutter instead.</p>
<p dir="ltr">I think it wise to encourage TDD.</p>
<p dir="ltr"><a href="https://github.com/audreyr/cookiecutter/blob/master/README.rst#python">https://github.com/audreyr/cookiecutter/blob/master/README.rst#python</a></p>
<p dir="ltr">><br>
> Paul<br>
> _______________________________________________<br>
> Distutils-SIG maillist - <a href="mailto:Distutils-SIG@python.org">Distutils-SIG@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/distutils-sig">https://mail.python.org/mailman/listinfo/distutils-sig</a><br>
</p>