473,289 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

trying to remember how to do inline code "testing"

I can remember Python having a feature which allowed you to add some
simple tests to your code, something like adding console output to your
actual python script, like so:

>>1+1
2
>>2*7
14
.... then python would actually run these queries and check that the
expected results occurred.
I can't find the docs for this feauture anywhere, but I'm certain I
didn't imagine this one!
Can anyone give me a reference?

thanks,
Alex
Oct 24 '07 #1
2 1234
Alex Hunsley wrote:
I can remember Python having a feature which allowed you to add some
simple tests to your code, something like adding console output to your
actual python script, like so:

>>1+1
2
>>2*7
14
... then python would actually run these queries and check that the
expected results occurred.
I can't find the docs for this feauture anywhere, but I'm certain I
didn't imagine this one!
Can anyone give me a reference?
http://docs.python.org/lib/module-doctest.html

Diez
Oct 24 '07 #2
Diez B. Roggisch wrote:
Alex Hunsley wrote:
>I can remember Python having a feature which allowed you to add some
simple tests to your code, something like adding console output to your
actual python script, like so:

> >>1+1
2
> >>2*7
14
... then python would actually run these queries and check that the
expected results occurred.
I can't find the docs for this feauture anywhere, but I'm certain I
didn't imagine this one!
Can anyone give me a reference?

http://docs.python.org/lib/module-doctest.html

Diez
Brilliant, thanks for that Diez!
Alex
Oct 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
77
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for...
3
by: David | last post by:
I found and interesting article, "Experiences of Using PHP in Large Websites" (http://www.ukuug.org/events/linux2002/papers/html/php/) , which lists some issues with scaling PHP for larger...
7
by: Lyle Fairfield | last post by:
I suppose something like this may have been posted before. I am unaware of it. It's intended to duplicate the gradient filter that MS provides in their manifestation of CSS. Yes, I know it...
0
by: Simon Verona | last post by:
I have some Windows Forms software that I'm developing that uses a remote server (called using remoting) to provide the business rules and dataaccess. For development purposes the client and...
30
by: bblais | last post by:
Hello, Let me start by saying that I am coming from a background using Matlab (or Octave), and C++. I am going to outline the basic nuts-and-bolts of how I work in these languages, and ask for...
17
by: David C. Ullrich | last post by:
Having a hard time phrasing this in the form of a question... The other day I saw a thread where someone asked about overrideable properties and nobody offered the advice that properties are...
3
by: Baron Samedi | last post by:
I am looking for a reliable cross-browser pull-quote solution in CSS. See for instance, http://www.sitepoint.com/examples/pullquotes/ The problem seems at first to be sure that it functions...
24
by: Jeremy J Starcher | last post by:
While reading c.l.j, I've noticed that some people prefer and indeed even recommend the use of "window.alert()" over "alert()". I can't find any technical reason to make this distinction, and...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.