Re: testing code

2018-07-08 Thread Sharan Basappa
On Sunday, 8 July 2018 12:42:07 UTC+5:30, Christian Gollwitzer wrote: > Am 08.07.18 um 06:21 schrieb Sharan Basappa: > > sorry. there was a copy paste error when i posted. I pasted test_2.py for > > both the files: > > > > here are the files again. The issue remains. > > > output: > > %run "D:/

Re: testing code

2018-07-08 Thread Christian Gollwitzer
Am 08.07.18 um 06:21 schrieb Sharan Basappa: sorry. there was a copy paste error when i posted. I pasted test_2.py for both the files: here are the files again. The issue remains. output: %run "D:/Projects/Initiatives/machine learning/programs/test_2_test.py" 30 Jim spotted it... '%run' i

Re: testing code

2018-07-08 Thread Sharan Basappa
On Sunday, 8 July 2018 11:52:39 UTC+5:30, Jim Lee wrote: > On 07/07/18 21:21, Sharan Basappa wrote: > > > > sorry. there was a copy paste error when i posted. I pasted test_2.py for > > both the files: > > > > here are the files again. The issue remains. > > [...] > > > > output: > > %run "D:/Pro

Re: testing code

2018-07-07 Thread Jim Lee
On 07/07/18 21:21, Sharan Basappa wrote: sorry. there was a copy paste error when i posted. I pasted test_2.py for both the files: here are the files again. The issue remains. [...] output: %run "D:/Projects/Initiatives/machine learning/programs/test_2_test.py" 30 [11:24 PM jlee@kerndev ~

Re: testing code

2018-07-07 Thread Sharan Basappa
On Saturday, 7 July 2018 18:22:23 UTC+5:30, Chris Angelico wrote: > On Sat, Jul 7, 2018 at 10:02 PM, Sharan Basappa > wrote: > > On Friday, 6 July 2018 09:22:31 UTC+5:30, Chris Angelico wrote: > >> On Fri, Jul 6, 2018 at 12:56 PM, Sharan Basappa > >> wrote: > >> > Please let me know if the foll

Re: testing code

2018-07-07 Thread Chris Angelico
On Sat, Jul 7, 2018 at 10:02 PM, Sharan Basappa wrote: > On Friday, 6 July 2018 09:22:31 UTC+5:30, Chris Angelico wrote: >> On Fri, Jul 6, 2018 at 12:56 PM, Sharan Basappa >> wrote: >> > Please let me know if the following understanding of mine is correct. >> > I need to put the program code in

Re: testing code

2018-07-07 Thread Sharan Basappa
On Friday, 6 July 2018 09:22:31 UTC+5:30, Chris Angelico wrote: > On Fri, Jul 6, 2018 at 12:56 PM, Sharan Basappa > wrote: > > Please let me know if the following understanding of mine is correct. > > I need to put the program code in a separate file and organize every > > executable code in som

Re: testing code

2018-07-06 Thread Sharan Basappa
On Friday, 6 July 2018 09:22:31 UTC+5:30, Chris Angelico wrote: > On Fri, Jul 6, 2018 at 12:56 PM, Sharan Basappa > wrote: > > Please let me know if the following understanding of mine is correct. > > I need to put the program code in a separate file and organize every > > executable code in som

Re: testing code

2018-07-06 Thread Sharan Basappa
mmon, almost universal, requirement and there > is > a standard idom for arranging it. > > Support you have your code in the file "foo.py" (because I need a concrete > filename for the example). It might look like this at present: > > def func1(...): > >

Re: testing code

2018-07-05 Thread Cameron Simpson
func2(...): x = func1(...) y = func2(...) print(x + y) i.e. some function definitions and then you testing code. Now, you can write another file "foo_tests.py" which starts like this: import foo ... run some tests of foo.func1, foo.func2 etc ... The issue is that as written,

Re: testing code

2018-07-05 Thread Chris Angelico
On Fri, Jul 6, 2018 at 12:56 PM, Sharan Basappa wrote: > Please let me know if the following understanding of mine is correct. > I need to put the program code in a separate file and organize every > executable code in some form of function. If any code exists outside of > function then it is no

testing code

2018-07-05 Thread Sharan Basappa
Hi All, I am new to Python though not new to programming. I have implemented my first program in python that uses ML to do some classification task. The whole code is in a single file currently. It contains executable code as well as functions. At the end of the program, I have series of calls

Re: testing code in python source package

2009-09-21 Thread Ben Finney
Peng Yu writes: > I'm wondering if the development of python is test driven. If it is, > where in the Python-2.6.2 source directory is the test code for the > modules in ./Lib? A great majority of your many questions in this forum are already answered in the available documentation online. You s

Re: testing code in python source package

2009-09-20 Thread alex23
Peng Yu wrote: > I'm wondering if the development of python is test driven. If it is, > where in the Python-2.6.2 source directory is the test code for the > modules in ./Lib? Unsurprisingly, they're located in Lib/test. Is it _really_ that difficult to find? -- http://mail.python.org/mailman/li

testing code in python source package

2009-09-20 Thread Peng Yu
Hi, I'm wondering if the development of python is test driven. If it is, where in the Python-2.6.2 source directory is the test code for the modules in ./Lib? Regards, Peng -- http://mail.python.org/mailman/listinfo/python-list

proxy testing code with multi-thread

2008-02-01 Thread [EMAIL PROTECTED]
hi all I'm now meeting some problem when using threading to test whether or not a proxy is good or not and the total number of proxies is just 60 but each time my programme stopped just at approaching the end, say, for each proxy I made a proxy but it just stopped working at maybe 58 or 59 or some

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-04 Thread Brian van den Broek
Jeremy Bowers said unto the world upon 2005-04-04 17:26: On Mon, 04 Apr 2005 17:02:20 -0400, Brian van den Broek wrote: Jeremy suggested using a directory name akin to "C:\onlyanidiotwouldhavethisdirecotrynameonadrive". That is what I had settled on before I posted. Somehow it feels unhappy and i

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-04 Thread Jeremy Bowers
On Mon, 04 Apr 2005 17:02:20 -0400, Brian van den Broek wrote: > Jeremy suggested using a directory name akin to > "C:\onlyanidiotwouldhavethisdirecotrynameonadrive". That is what I had > settled on before I posted. Somehow it feels unhappy and inelegant. > But, I'm a bit less uncomfortable with

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-04 Thread Brian van den Broek
"Brian van den Broek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi all, I'm just starting to employ unit testing (I'm using doctest), and I am uncertain how to handle writing tests where the behaviour being tested is dependant on whether certain file paths point to actual file

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-02 Thread Terry Reedy
"Brian van den Broek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > I'm just starting to employ unit testing (I'm using doctest), and I am > uncertain how to handle writing tests where the behaviour being tested is > dependant on whether certain file paths point to ac

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-02 Thread Jeremy Bowers
On Sat, 02 Apr 2005 15:30:13 -0500, Brian van den Broek wrote: > So, how does one handle such cases with tests? When I had a similar situation, I created a directory for testing that was in a known state, and tested on that. If you can test based on a relative directory, that should work OK. Non-

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-02 Thread Grig Gheorghiu
Can't you use the tempfile module to generate unique names for non-existent files and directories? Take a look at http://www.python.org/doc/lib/module-tempfile.html -- it works on all supported platforms. Grig -- http://mail.python.org/mailman/listinfo/python-list

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-02 Thread Andrà Malo
* Brian van den Broek wrote: > The relevant part of the validation method code looks like: > > # self.universe_files is a list of file paths > non_existent_files = [ x for x in self.universe_files if > not os.path.isfile(x) ] > if non_existen

testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-02 Thread Brian van den Broek
Hi all, I'm just starting to employ unit testing (I'm using doctest), and I am uncertain how to handle writing tests where the behaviour being tested is dependant on whether certain file paths point to actual files. I have a class which takes, in its __init__, a list of file paths to process. The