Re: [Tutor] Need advice on testing python code.

2017-08-28 Thread Anubhav Yadav
> Here is the compatibility list of plugins: > http://plugincompat.herokuapp.com/ > > here is the rabbitmq plugin: > https://pypi.python.org/pypi/pytest-rabbitmq > > > and here is one for databases: > https://p

Re: [Tutor] Need advice on testing python code.

2017-08-28 Thread Anubhav Yadav
Hi George, > And pytest has more than 200 plugins to make it easier to test things. As I > remember it has mongo plugin as we well > Thank you for your comments. I have been using `py.test` for only two reasons. 1. To run my tests places in the `/tests` directory. 2. To run them whenever I

[Tutor] Need advice on testing python code.

2017-08-27 Thread Anubhav Yadav
Hello. I am a python developer and I write a lot of python code everyday. I try to do as much unit testing as possible. But I want to be better at it, I want to write more test cases, specially that rely on database insertions and reads and file io. Here are my use-cases for testing. How to te

Re: [Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-07 Thread Anubhav Yadav
> > Be careful. Now you have a test that always succeeds. > > No, I'm wrong. Sorry about that: I misread the numerical range. > This is the first time I am ever writing unit tests, and I am glad I am doing it. Thanks a lot for all your help!. ___ Tuto

Re: [Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-07 Thread Anubhav Yadav
msg="Test failed for {}".format(test_value)) And now everything works the way it should. Thanks for all your help :) -- Regards, Anubhav Yadav KPIT Technologies, Pune. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-07 Thread Anubhav Yadav
> Hi Anubhav, > > Ah! The assert functions are meant to be used as statements, not as > composable expressions. If you're familiar with the idea of side effects, > then you need to understand that you should be calling the assert functions > just for their side effects, not for their return value

[Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-06 Thread Anubhav Yadav
Hello Everyone, I am trying to write a simple program that generated random numbers based on some rules. when my program is in the yellow state, it should generate the numbers from 100.0-100.5 and 102.5-103.0. When my program is in the red state, it should generate numbers in the range less than 9

Re: [Tutor] Help understanding list comprehensions

2015-06-18 Thread Anubhav Yadav
So I need to create a copy of the list before trying to iterate through the list. Thanks a lot everyone for their answers. Cheers. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/list

Re: [Tutor] Help understanding list comprehensions

2015-06-17 Thread Anubhav Yadav
Either the subject is misleading or you misunderstand something. Im am sorry to tell you the great truth, but there was no list comprehension in your code at all, just a list. Comprehension is what Alan wrote for you, that is the next step in studying Python, when you already understand lists and

Re: [Tutor] Help understanding list comprehensions

2015-06-16 Thread Anubhav Yadav
I am sorry I didn't posted my code. I had solved this question long back on hackerrank, and I couldn't figure out why this behaviour was seen in this problem, so I had posted this question on their discussion forum. Couldn't get a good answer so I decided to post here. Luckily I found the revision

[Tutor] Help understanding list comprehensions

2015-06-16 Thread Anubhav Yadav
I have a doubt. I had a list like this [['Varun', 19.0], ['Kakunami', 19.0], ['Harsh', 20.0], ['Beria', 20.0], ['Vikas', 21.0]] I am using a for loop to del the rows with the lowest value like this: for row in marks: if row[1] == lowest: marks.remove(row) But after running this loo

[Tutor] Implementing a Media Streaming Server in Python

2015-05-18 Thread Anubhav Yadav
the best way to design the video/media streaming server? Thank you. -- Regards, Anubhav Yadav ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] TCP server/client application failing. Need some help with the basics!

2015-05-12 Thread Anubhav Yadav
The other thing I'd consider is the timing of your requests. > I didn't check but have you a decent gap between requests > or are all 5000 arriving nearly simultaneously? It may > be a network configuration issue - the socket/port queue > simply getting choked to the poi

[Tutor] TCP server/client application failing. Need some help with the basics!

2015-05-11 Thread Anubhav Yadav
I am very new to python. I have been a very mediocre programmer, but now I have decided that I want to level up as a programmer. I wanted to write a simple TCP client/server (where in the server acts as a simple TCP Listener). I searched on the forums and I saw that people advised using frameworks

Re: [Tutor] Need some help with setuptools for my project.

2015-04-08 Thread Anubhav Yadav
you can do it all as yourself. > Thanks a lot, I would now spend some time learning virtualenv! This has really helped me. Thank you everyone again for helping me out. I would bring the thread alive again if I am stuck somewhere. Cheers Regards, Anubhav Yadav Pune. _

Re: [Tutor] Need some help with setuptools for my project.

2015-04-08 Thread Anubhav Yadav
setup.py develop`` with root privileges? Just to test the app first? -- Regards, Anubhav Yadav Pune. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need some help with setuptools for my project.

2015-04-07 Thread Anubhav Yadav
giving me the PEP8 link, it will be helpful. > > [1] > https://pythonhosted.org/setuptools/setuptools.html#automatic-script-creation > [2] https://www.python.org/dev/peps/pep-0008/ > > > — > > Dylan Evans > -- Regards, Anubhav Yadav KPIT Technologies, Pune. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need some help with setuptools for my project.

2015-04-07 Thread Anubhav Yadav
691/scorer.py/tree/structureCode [2] http://blog.habnab.it/blog/2013/07/21/python-packages-and-you/ -- Regards, Anubhav Yadav KPIT Technologies, Pune. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need some help with setuptools for my project.

2015-04-07 Thread Anubhav Yadav
r community, you > can put it on PyPI. See: > https://docs.python.org/2/distutils/packageindex.html > I would love to upload my script to PyPi, but first I need to figure out if my project is getting installed properly using setuptools or not. -- Regards, Anubhav Yadav

[Tutor] Need some help with setuptools for my project.

2015-04-06 Thread Anubhav Yadav
cription = 'A simple script to show desktop notifications for cricket scores', long_description = readme(), url = 'https://github.com/neo1691/scorer.py', author = 'Anubhav Yadav', author_email = 'anubhav1...@gmail.com', licens

Re: [Tutor] Does anyone here has the problems of CS231 saved?

2015-02-15 Thread Anubhav Yadav
ones that were latest, I think I can do with it. Thanks again. -- Regards, Anubhav Yadav KPIT Technologies, Pune. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Does anyone here has the problems of CS231 saved?

2015-02-15 Thread Anubhav Yadav
se231/PracticeOfComputingUsingPython/ -- Regards, Anubhav Yadav ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need a little help in formatting print statement

2014-12-07 Thread Anubhav Yadav
18382931264449e+18 > 1.1220184543019653e+19 > > I had read about this formatter before, thanks a lot. Cheers!! -- Regards, Anubhav Yadav KPIT Technologies, Pune. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Need a little help in formatting print statement

2014-12-07 Thread Anubhav Yadav
stions would be greatly appreciated. -- Regards, Anubhav Yadav KPIT Technologies, Pune. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor