• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Tiny Python Projects: for intermediate/advanced devs?

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ken

I love the concept of this book because I'm not a python developer by trade, but I do write python programs semi-regularly. Each time I return to code there's always some time wasted ramping-up before I get back into the flow So its nice to have a set of gradual exercises I can work on when I don't have a programming project in hand.

I have 2 questions for you:
1) One of the bits of testing that I often stumble on are mocks. Is this covered in your book?
2) The content looks like it starts at a beginner level. Are there any plans to build more content like this at an intermediate/advanced level?

Cheers,
Greg
 
Ranch Hand
Posts: 66
1
Redhat Notepad Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Greg Horie

I also find mocks to be problematic while testing, especially with API calls and responses (and that's where nose2 framework usually comes in place).
Quick search inside the book did not reveal any real example of mocking, except for "mocking" file handle so that you don’t have to read an actual file, but just the value that can produce "lines" of text.

BTW There are some intermediate topics, like new TypedDict class introduced in later Python3 versions, so it is a good balance.
 
Greg Horie
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your comments @Lucian Maly.

These days I use pytest for python testing. I have used the older nose test framework, but not nose2. I'd like to see an example of how nose2 helps to address mocking. I've Googled around, but I don't see an obvious examples. Could you provide a link to show me what you're referring to?
 
Lucian Maly
Ranch Hand
Posts: 66
1
Redhat Notepad Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Greg Horie wrote:Thanks for your comments @Lucian Maly.

These days I use pytest for python testing. I have used the older nose test framework, but not nose2. I'd like to see an example of how nose2 helps to address mocking. I've Googled around, but I don't see an obvious examples. Could you provide a link to show me what you're referring to?



Look at this example using nose2 and requests: https://github.com/kimobrian/Python-API-Testing
 
Greg Horie
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, maybe I misunderstood your earlier statement. You mentioned this:

I also find mocks to be problematic while testing, especially with API calls and responses (and that's where nose2 framework usually comes in place)



I thought you were saying nose2 helps address issues around mocking.
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic