Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Sphinxtest
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
The_COM@gmx.de  
View profile  
 More options Nov 1 2009, 12:13 pm
From: "The_...@gmx.de" <The_...@gmx.de>
Date: Sun, 1 Nov 2009 09:13:03 -0800 (PST)
Local: Sun, Nov 1 2009 12:13 pm
Subject: Sphinxtest
Hi all,

I've uploaded a patch with a WIP-version of the sphinx extension I'm
hacking on. It's about doctests with fixtures similar to unittests. So
far it generates html output and allows you to run your documentation
as a normal unittest testsuite. I've written some documentation and
added it to the sphinx documentation.

What do you think about this?

Regards,
Ontje


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
SHIBUKAWA Yoshiki  
View profile  
 More options Nov 7 2009, 5:18 am
From: SHIBUKAWA Yoshiki <yosh...@shibu.jp>
Date: Sat, 7 Nov 2009 19:18:20 +0900
Local: Sat, Nov 7 2009 5:18 am
Subject: Re: [sphinx-dev] Sphinxtest
Hi Ontje,

I'm thinking same thing and just started implementing.

Behavior Driven Development(BDD) tries to get closer to documentation
rather than TDD.
So I think BDD tools is more friendly to Sphinx. Techinically, BDD and
TDD are very close.
These are just different in method's names.

And more, I'm interested in cucumber's test. It is implemented on Ruby/Rspec.

Thanks,
SHIBUKAWA Yoshiki

2009/11/2 The_...@gmx.de <The_...@gmx.de>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Withers  
View profile  
 More options Nov 7 2009, 5:40 am
From: Chris Withers <ch...@simplistix.co.uk>
Date: Sat, 07 Nov 2009 10:40:11 +0000
Local: Sat, Nov 7 2009 5:40 am
Subject: Re: [sphinx-dev] Sphinxtest

The_...@gmx.de wrote:
> I've uploaded a patch with a WIP-version

What is a WIP-version?

> hacking on. It's about doctests with fixtures similar to unittests.

Have you looked at Manuel?

http://packages.python.org/manuel/

> So
> far it generates html output

Why are you looking for html output?

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ontje Lünsdorf  
View profile  
 More options Nov 9 2009, 2:26 pm
From: Ontje Lünsdorf <The_...@gmx.de>
Date: Mon, 9 Nov 2009 20:26:49 +0100
Local: Mon, Nov 9 2009 2:26 pm
Subject: Re: [sphinx-dev] Re: Sphinxtest

Hi Chris,

Am Samstag, 7. November 2009 11:40:11 schrieb Chris Withers:

> What is a WIP-version?

A Work in progress version ;) That version is far from perfect and I just
wanted to get general feedback on the idea.

> Have you looked at Manuel?

No, not yet. Thanks for the hint.

From a first glance there is some functionality I was looking for (running the
documentation as testsuites to embed them in continuous testing utilities like
bitten).

The syntax I realized is more testsuite centric. For example a testsuite in
your documentation will look like this:

-----------8<--------------------------------
.. fixture:: simple_fixture

    >>> a = 5 # Assign a variable.

    >>> if a != 10: raise ValueError('w00t? I can\'t multiply!')

.. test:: testcase_with_fixture
    :fixtures: simple_fixture

    >>> a *= 2

    This test doesn't fail because ``a`` has been assigned in the setup code.

    Also take a look at the teardown code. As that is a doctest too, failures
    will be reported as they would in a normal unittest.
------------------------>8--------------------

Note that the above two paragraphs are inlined documentation for the testcase.

> Why are you looking for html output?

This will result in html output as in the attached screenshot. I hope that the
integration of testsuite in your documentation will lead to uncryptic and
understandable testcode as I've seen it in my own and other projects ;-)

Also note that each testcase is run in its own environment to prevent
aftereffects. I know that this can be done with doctest blocks as well, but
they don't integrate well with testsuites as far as I know.

So, do you think that there's the need for something like this?

Regards,
Ontje

  sphinxtest.png
39K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Georg Brandl  
View profile  
 More options Nov 11 2009, 4:47 am
From: Georg Brandl <ge...@python.org>
Date: Wed, 11 Nov 2009 10:47:27 +0100
Local: Wed, Nov 11 2009 4:47 am
Subject: Re: [sphinx-dev] Re: Sphinxtest
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ontje Lünsdorf schrieb:

Are you aware of the existing doctest extension (if not, see
http://sphinx.pocoo.org/ext/doctest.html)?  It already does something similar;
but not as sophisticated.  It is more oriented towards making sure that the
examples you give in the documentation don't stop working.

Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.13 (GNU/Linux)

iEYEARECAAYFAkr6iC8ACgkQN9GcIYhpnLAtvgCffScI88nec/MYC6E95N/Cpsym
u44An2V07zeqGfx6sp1JVAYY4Yllk6xw
=JCR3
-----END PGP SIGNATURE-----


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ontje Lünsdorf  
View profile  
 More options Nov 11 2009, 9:12 am
From: Ontje Lünsdorf <The_...@gmx.de>
Date: Wed, 11 Nov 2009 15:12:42 +0100
Local: Wed, Nov 11 2009 9:12 am
Subject: Re: [sphinx-dev] Re: Sphinxtest
Hi Georg,

Am Mittwoch 11 November 2009 10:47:27 schrieb Georg Brandl:

> Are you aware of the existing doctest extension (if not, see
> http://sphinx.pocoo.org/ext/doctest.html)?  It already does something
>  similar; but not as sophisticated.  It is more oriented towards making
>  sure that the examples you give in the documentation don't stop working.

Yes, in fact I've used it extensively before. It's very nice but there were at
least two drawbacks which I tried to circumvent with sphinxtest:

Doctests in a documentation file are run as a singular test. But you often want
to test your code in different use-cases which you don't want to scatter over
multiple files. If all tests are run in a singular environment it may get messy
to find the root cause of a failure.

The sphinx doctest builder is difficult to integrate into other utilities like
continuous testing frameworks (these usually expect unittests).

I will experiment a bit more with doctest blocks and see if I can get
comfortable with those :)

Regards,
Ontje


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Georg Brandl  
View profile  
 More options Nov 11 2009, 1:49 pm
From: Georg Brandl <georg.bra...@gmail.com>
Date: Wed, 11 Nov 2009 10:49:55 -0800 (PST)
Local: Wed, Nov 11 2009 1:49 pm
Subject: Re: Sphinxtest
On 11 Nov., 15:12, Ontje Lünsdorf <The_...@gmx.de> wrote:

I'm not saying you have to use the doctest extension :) As I said,
it's not a
serious unittesting tool, but to make sure that snippets continue to
work.
(In docs, you often use objects created earlier in later snippets, so
the shared
environment makes sense.)  I just wanted to make sure you know that it
exists.

What you're developing looks very interesting, because it could at one
point
combine documentation and tests -- kind of "literate testing" :)

Georg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Withers  
View profile  
 More options Nov 11 2009, 2:20 pm
From: Chris Withers <ch...@simplistix.co.uk>
Date: Wed, 11 Nov 2009 19:20:19 +0000
Local: Wed, Nov 11 2009 2:20 pm
Subject: Re: [sphinx-dev] Re: Sphinxtest

Ontje Lünsdorf wrote:
> Doctests in a documentation file are run as a singular test. But you often want
> to test your code in different use-cases which you don't want to scatter over
> multiple files. If all tests are run in a singular environment it may get messy
> to find the root cause of a failure.

http://packages.python.org/manuel/#test-isolation

> The sphinx doctest builder is difficult to integrate into other utilities like
> continuous testing frameworks (these usually expect unittests).

http://packages.python.org/manuel/#using-unittest

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »