473,396 Members | 1,799 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,396 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 1236
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.