Pony ORM lambda or generator expression function is marked as unexecuted
See original GitHub issueHi, Here a small matter I have with ponyorm. In ponyorm you can make query to database with lambda or generator expressions. those 2 thing are equivalent :
return Praticien.select(lambda p: p.nom_d_exercice.lower().startswith(chaine.lower()))
return select(p for p in Praticien if p.nom_d_exercice.lower().startswith(chaine.lower()))
html report says :port says :
The line 98 didn't finish lmabda on line 98
or
lne 98 didn't run generator expression in line 98
seems that smaller expression are ok :
Praticien.select()
I really would help to try fix it but I do not know where to start
Thank you Jimmy
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Queries — Pony ORM documentation
Pony allows to use generator expressions as a very natural way of writing database queries. Pony provides select() function which accepts Python generator, ......
Read more >ponyORM: trouble with query - python - Stack Overflow
I have query with dynamic conditions,i.e. select (lambda obj:obj.A = ...
Read more >the 2 of 3 and 4 0 5 to 6 a 7 in 8 1 9 for 10 image 11 2 12 is 13
... 877 traffic 878 five 879 function 880 michigan 881 power 882 professional ... 1604 host 1605 pollution 1606 multiple 1607 mark 1608...
Read more >librispeech-vocab.txt - OpenSLR
... CHECK CHECK'D CHECK'S CHECKBOOK CHECKED CHECKER CHECKERBERRIES CHECKERBERRY ... EXPRESSE EXPRESSED EXPRESSES EXPRESSETH EXPRESSIBLE EXPRESSIN EXPRESSING ...
Read more >Untitled
Phut cuoi che linh karaoke, Latin music fest chicago, Unexecuted bench ... Nh178l! 2 organ systems and their functions, Tangadan falls cliff diving, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Some other possibilities of how to handle this more gracefully:
You can set the coverage.py pragma regex so that some lines are automatically pragma’d:
Now any line that matches either of the two regexes will be considered partial-branch, so your line is recognized even without a comment.
You can separate the definition of the lambda or generator expression from the line that uses them:
or:
This isolates the non-run code to its own line, so you don’t run the risk of turning off coverage measurement on a line that truly needs it.
Hello,
See this: https://stackoverflow.com/questions/53280985/how-to-ignore-ponyorm-generator-expressions-in-nose-tests-coverage/53281148#53281148
I’ve tried to solve is with
#pragma: no branch
, it works some time. but some time you need to also use#pragma: no coverage