Saturday, July 9, 2011

Behind the scenes of py.test's new assertion rewriting

py.test 2.1 was just released. py.test, which uses the Python assert statement to check test conditions, has long had support for displaying intermediate values in subexpressions of a failing assert statement. This feature is called assertion introspection. Historically, py.test performed assertion introspection by reinterpreting failed assertions in order to glean information about subexpressions. In assertion reinterpreting, py.test actually reruns the assertion noting intermediate values during interpretation. This works pretty well but is subject to several problems, most importantly that assert statements with side-effects can produce strange results because they are evaluated twice on failure. py.test 2.1's main new feature, which I wrote (with generous sponsorship from Merlinux GmbH), is a new assertion introspection technique called assertion rewriting. Assertion rewriting modifies the AST of test modules to produce subexpression information when assertions fail. This blog post will give a peek into how this is done and what the rewritten tests look like.

py.test tries to rewrite every module that it collects as a test module. Assertion rewriting uses a PEP 302 import hook to capture test modules for rewriting. I'm happy to report doing this was easier than I expected. Most of the code in the import hook I had to write was dealing with detecting test modules rather than supporting import's extremely complicated API. Rewriting has a non-zero cost during test collection, so py.test compiles rewritten modules to bytecode and caches them in the PEP 3147 PYC repository, __pycache__. One major thing I did have to account for was the possibility that multiple py.test processes would be writing PYC files. (This is a very real possibility when the xdist plugin is being used. Therefore, py.test uses only atomic operations on the rewritten PYC file. Windows, lacking atomic rename, was a pain here.

I'm now going to demonstrate what py.test's rewriting phase does to a test module. Let's dive in with a failing test for a (broken) function that is supposed to create empty files:

import os

def make_empty_file(name):
with open(name, "w") as fp:
fp.write("hello")

def test_make_empty_file():
name = "/tmp/empty_test"
make_empty_file(name)
with open(name, "r") as fp:
assert not fp.read()


This test nicely demonstrates the problem with py.test's old assertion method mentioned in the first paragraph. If we force the old assertion interpretation mode with --assert=reinterp, we see:


def test_make_empty_file():
name = "/tmp/empty_test"
make_empty_file(name)
with open(name, "r") as fp:
> assert not fp.read()
E AssertionError: (assertion failed, but when it was re-run for printing intermediate values, it did not fail. Suggestions: compute assert expression before the assert or use --no-assert)

test_empty_file.py:11: AssertionError


The problem is that assert statement has the side-effect of reading the file. When py.test reinterprets the assert statement, it uses the same file object, now at EOF, and read() returns an empty string. py.test's new rewriting mode fixes this by scanning the assert for introspection information before executing the test. Running py.test with assertion rewriting enabled gives the desired result:


def test_make_empty_file():
name = "/tmp/empty_test"
make_empty_file(name)
with open(name, "r") as fp:
> assert not fp.read()
E assert not 'hello'
E + where 'hello' = ()
E + where = .read

test_empty_file.py:11: AssertionError


So what magic has py.test worked to display such nice debugging information? This is what Python is actually executing:

def test_make_empty_file():
name = '/tmp/empty_test'
make_empty_file(name)
with open(name, 'r') as fp:
@py_assert1 = fp.read
@py_assert3 = @py_assert1()
@py_assert5 = (not @py_assert3)
if (not @py_assert5):
@py_format6 = ('assert not %(py4)s\n{%(py4)s = %(py2)s\n{%(py2)s = %(py0)s.read\n}()\n}' %
{'py0': (@pytest_ar._saferepr(fp) if ('fp' in @py_builtins.locals() is not @py_builtins.globals()) else 'fp'),
'py2': @pytest_ar._saferepr(@py_assert1),
'py4': @pytest_ar._saferepr(@py_assert3)})
raise AssertionError(@pytest_ar._format_explanation(@py_format6))
del @py_assert5, @py_assert1, @py_assert3


As you can see, it's not going to be winning any awards for beautiful Python! (Ideally, though, you'll never have to see or think about it.) Examining the rewritten code, we see a lot of internal variables starting with "@" have been created. The "@", invalid in Python identifiers, is to make sure internal names don't conflict with any user-defined names which might be in the scope. In the first four written lines under the with statement, the test of the assert statement has been expanded into its component subexpressions. This allows py.test to display the values of subexpressions should the assertion fail. If the assertion fails, the if statement in the fifth line of rewriting evaluates to True and a AssertionError will be raised. Under the if statement is the real mess. This is where the helpful error message is generated. The line starting with @py_format6 is simply does string formatting (with %) on a template generated from the structure of the assert statement. This template is filled in with the intermediate values of the expressions collected above. @py_builtins is the builtins module, used in case the test is shadowing builtins the rewriting code uses. The @pytest_ar variable is a special module of assertion formatting helpers. For example, @pytest_ar._saferepr is like builtin repr but gracefully handles long reprs and __repr__ methods that raise exceptions. A non-obvious trick in the format dict is the expression @pytest_ar._saferepr(fp) if ('fp' in @py_builtins.locals() is not @py_builtins.globals()) else 'fp'. This checks whether fp is a local variable or not and customizes the display accordingly. After the initial formatting, the helper function _format_explanation is called. This function produces the indentation and "+" you see in the error message. Finally, we note that if the assertion doesn't fail, py.test cleans up after itself by deleting temporary variables.

The example above is a fairly tame (and luckily also typical) assertion. Rewriting gets more "exciting" when boolean operations and comparisons enter because they require short circuit evaluation, which complicates both the expansion of expressions and formatting (think lots of nested ifs).

In conclusion, py.test's new assertion rewriting fixes some long standing issues with assertion introspection and continues py.test's long tradition of excellent debugging support. (There are now three(!) assertion introspection methods in py.test: two reinterpretation implementations as well as rewriting) I just hope I haven't scared you completely off py.test! :)

164 comments:

  1. How easy do you think it would be to abstract out the assertion rewriting and reuse it with other test frameworks?

    Could it even be done as a standalone library?

    ReplyDelete
  2. @Michael The assertion stuff is not very dependent on py.test internals, so it should be easy to separate them out if you wanted to. In fact, until recently, assertion introspection code was in the pylib, a separate library than py.test.

    ReplyDelete
  3. Nice.

    Though I strongly discourage people from using the assert statement in most non-trivial cases in Python due to its syntax oddity and the common error of using ()s that changes the assert into an assert of an always true tuple.

    ReplyDelete
    Replies
    1. Hi, this is such a great article.
      Think you just about covered everything on blog commenting,
      I’ll bookmark your site and come back to read your
      other articles!
      Printer
      Bitcoin
      Android
      Pertanian
      Robotics

      Delete
  4. @gps In recent versions of Python, the compiler will give you a warning if you make a vacuous assert statement.

    $ python3
    Python 3.1.3 (r313:86834, Feb 27 2011, 22:48:24)
    [GCC 4.4.5] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> assert (3, "msg")
    :1: SyntaxWarning: assertion is always true, perhaps remove parentheses?

    ReplyDelete
  5. People interested in this should also check out "bindann":

    http://tahoe-lafs.org/trac/bindann

    It inspects the stack and the source code to extract the values that are relevant to the failing exception. Very cool! I feel like it should have gotten a lot more attention than it did when it was first created.

    Disclosure: my brother invented it while staying rent free in my house, and he is super awesome and I love him, so I might be a tad bit biased.

    ReplyDelete
  6. @Zooko sounds promising, but where is it gone? The link is broken.

    Interesting also your own quote from September 14, 2007 in commit 8fd98624:

    don't try to use bindann

    It causes a mysterious misbehavior in Python import which causes the previous patch to fail (the patch to not run trial tests if dependencies can't be imported)

    ReplyDelete
  7. Sometime few educational blogs become very helpful while getting relevant and new information related to your targeted area. As I found this blog and appreciate the information delivered to my database.medium cursus

    ReplyDelete
  8. The next time I read a blog, I hope that it does not disappoint me as much as this one. I mean, Yes, it was my choice to read, but I really thought you would probably have something interesting to talk about. All I hear is a bunch of whining about something that you can fix if you weren't too busy searching for attention. onsite mobile repair bangalore Spot on with this write-up, I absolutely believe this site needs a lot more attention. I’ll probably be back again to read more, thanks for the information! asus display replacement You are so cool! I don't suppose I've truly read anything like this before. So wonderful to discover somebody with original thoughts on this subject. Really.. thank you for starting this up. This web site is something that is required on the web, someone with a little originality! huawei display repair bangalore

    ReplyDelete
  9. After looking at a few of the blog posts on your web page, I really appreciate your technique of blogging. I added it to my bookmark site list and will be checking back soon. Please visit my website as well and tell me what you think. vivo charging port replacement This site really has all of the info I needed about this subject and didn’t know who to ask. lg service center Bangalore There's definately a great deal to learn about this issue. I really like all the points you've made. motorola display repair bangalore

    ReplyDelete
  10. great article blog. keep posting like this with us.We offer the most budget-friendly quotes on all your digital requirements. We are available to our clients when they lookout for any help or to clear queries.

    Best SEO Services in Chennai | digital marketing agencies in chennai | Best seo company in chennai | digital marketing consultants in chennai | Website designers in chennai

    ReplyDelete
  11. I like the valuable info you provide on your articles. I will bookmark your weblog and check again here frequently. I'm fairly sure I will learn many new stuff right here! Good luck for the following! If you want to enjoy entertainment don't forget to visit สล็อต

    ReplyDelete
  12. Thanks for sharing nice information. I likes your post. They are so amazing article share.

    Free DoFollow Travel Blog Commenting Sites

    ReplyDelete
  13. Thanks for provide great informatic and looking beautiful blog, really nice required information & the things i never imagined and i would request, wright more blog and blog post like that for us. Thanks you once agian
    python training in bangalore

    python training in hyderabad

    python online training

    python training

    python flask training

    python flask online training

    python training in coimbatore

    ReplyDelete
  14. Great post, Thanks for provide a great informatic and looking beautiful blog, really nice required information & the things i never imagined and i would request, wright more blog and blog post like that for us. Thanks you once agian.

    ReplyDelete

  15. Book Tenride call taxi in Chennai at most affordable taxi fare for Local or Outstation rides. Get multiple car options with our Chennai cab service
    chennai to bangalore cab
    bangalore to chennai cab
    hyderabad to bangalore cab
    bangalore to hyderabad cab
    kochi to chennai cab

    ReplyDelete
  16. iot training in chennai - IoT Training in Chennai - IoT is one of the technologies which has a lot of scope at the very same time very less number of skilled employees in this technology which means this particular technology will give a huge success rate. Join the Best IOT Training Institute in Chennai now.

    Devops training Institute in Chennai - DevOps a combination of Development and operations has an better career .Jobs opportunities are there from startup companies to big mnc. Start to learn DevOps technology soon and secure your job now.

    blue prism training in Chennai - If you choose to learn the blue prism or automation tool you are supposed to have the programming language. start to learn the blue prism training from the Best Blue Prism Training Institute in Chennai.

    uipath training in Chennai - UI path technology is one of the fastest developing fields which has a lot of job opportunities such as software developer, Programmer and lot more. Join the Best Uipath Training Institute in Chennai.

    microsoft azure training in chennai -Microsoft azure technology is growing and soon it will be competitive aws. So students who start to learn Microsoft azure now will be well - paid in the future. Start to learn Microsoft azure training in Chennai.

    Chennai IT Training Center

    ReplyDelete
  17. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    splunk online training

    ReplyDelete
  18. Nice & Informative Blog !
    QuickBooks is an intuitive accounting application for small businesses to handle their finance,you may face some technical complications or queries that can crop up in this wonderful software. To fix such problems, call us on QuickBooks Customer Service.

    ReplyDelete
  19. Kim Ravida is a lifestyle and business coach who helps women in business take powerful money actions and make solid, productiveIamLinkfeeder IamLinkfeeder IamLinkfeeder IamLinkfeeder IamLinkfeeder IamLinkfeeder IamLinkfeeder IamLinkfeeder IamLinkfeeder IamLinkfeeder

    ReplyDelete
  20. You can do very creative work in a particular field. Exceptional concept That was incredible share. Skyfall Leather Jacket

    ReplyDelete
  21. excellent video! Thank you, sir! What a complicated task. It looks so beautiful



    link

    ReplyDelete
  22. Nice Blog !
    Get the best assistance on how to do QuickBooks Pro Update? We provide quick and effective service to every QuickBooks client.

    ReplyDelete
  23. I was looking like this information, this content very helpful

    Thanks

    Harley Davidson Bill Goldberg Leather Biker Jacket

    ReplyDelete
  24. Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live.
    food delivery near me
    food delivery Dundee
    dundee restaurants
    andaaz Dundee
    dundee restaurants
    biryani, kebab near me
    pizza near me

    ReplyDelete
  25. Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live.
    fast food restaurants
    bbq chicken
    chicken tikka
    pepperoni pizza,
    baguettes,
    tandoori nan
    fast food bradford

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. Leather fashion jacket never runs out of style and if you’re looking for best articles regarding Harley Davidson leather Jackets, you’re just at the right place.
    JnJ is a registered firm that deals with all kinds of leather jackets, including motorbike racing suits, motorbike leather jackets and leather vests, leather gloves, for both men and women.

    ReplyDelete
  28. can you buy weed online/ Best Marijuana Dispensary Online USA
    While cannabis plants have been grown since at least the 3rd millennium BCE, evidence suggests that it was being smoked for psychoactive effects at least 2,500 years ago in the Pamir Mountains; the earliest evidence found at a cemetery in what is today western China close to the tripoint with Tajikistan and Afghanistan.

    ReplyDelete
  29. Learn Linux and tech by following this website

    ReplyDelete
  30. LED Garage Lights are the best choice for the perfect lighting of garage and warehouses. The illumination of the LED Garage Lights increases the work efficiency of the people. It also ensures safety in the garage as it comes with numerous features. At LEDMyplace, we have the best quality LED Garage Lights that are the first choice of customers.

    ReplyDelete
  31. how led lights work, how do led lights work, how do leds work, how does the light bulb work

    ReplyDelete
  32. under bed lighting adds energy-efficient functionality to any bedroom. Here's everything you need to know about this trend.

    ReplyDelete
  33. Looking for the proper led strip lights or led lights under bed? Find shopping tips and recommendations for the best LED light strips in this buying guide!

    ReplyDelete
  34. LED lighting has proven itself to be an energy-saving option to traditional incandescent or fluorescent lightbulb. When it comes to being outdoors, though, do led lights attract bugs or deter them?

    ReplyDelete
  35. lights under bed djustable Beds With Beautyrest 12" Luxury Adjustable Bed Package (Plush) · Leggett & Platt S-Cape 2.0 ·

    ReplyDelete
  36. Thanks for sharing this blog, this blog is more useful to me. Fashion Bloggers In India

    ReplyDelete
  37. led under bed Under bed lighting adds a wow factor to your slumber spaces. Whether you're looking for LED or motion-sensing lights

    ReplyDelete
  38. LED pole lights ensure safety and security for the individuals in the exteriors. The critical applications areas of LED pole lights are walkways, landscape architecture, and parking lots. These light fixtures illuminate the outskirts with full brightness and minimize the risk of unfortunate accidents. In addition, LED pole lights are generally installed in the exteriors, so they have higher IP ratings and durable fixtures to withstand extreme weather conditions and dust.

    ReplyDelete
  39. Thank you so much for sharing It’s very helpful and useful
    More Info

    ReplyDelete
  40. Doron Gil, Ph.D., is an Expert on Self-Awareness and Relationshipsweb361.fr capturedcurrentnews.com

    ReplyDelete
  41. This is a very nice article. Everyone should read. Thanks for sharing. Don't miss it love doll

    ReplyDelete
  42. Are you still looking for the best place to purchase quality chemicals online? Purechemshop.com is the best place to purchase chemical of all kinds. Purechemshop.com is one of best online marketplace to purchase chemical online at best prices
    Purechemshop.com
    Purechemshop.com/product/buy-mescaline
    Purechemshop.com/4-Mec-Drug

    ReplyDelete
  43. Movie4Me is a top movie and leaked movie website

    ReplyDelete
  44. If you Want to Watch and Download New Movie Then visit Download Filmyzilla

    ReplyDelete
  45. How Do I Install TurboTax 2019 with CD Drive?

    TurboTax streamlines the process of preparing and filing taxes. However, new TurboTax users often ask how do I install TurboTax 2019 with a CD drive. If you too want the answer to this question, here it is! Firstly, take out the TurboTax CD and put it into the CD drive of your system. Once TurboTax software begins to install automatically, hold the Windows and R key. Now, choose to browse to open Windows Explorer and find the CD drive. Then, double click on the “setup.exe,” and after a few minutes, the installation process will get complete.

    ReplyDelete
  46. Thanks for posting this info. I just want to let you know that I just check out your site My Chemical Romance Jacket

    ReplyDelete
  47. Hey,

    Thanks for sharing such nice information.

    Are you from Canada, Ontario, and searching for the best Roofing Company Cambridge? Here, We are in this business for the last couple of years and we know client satisfaction is a must. Our team members are highly experienced and dedicated to their work.

    Roofing Company Cambridge | Roof Repair Services Cambridge | Roof Replacement Cambridge | Roofing Contractors Cambridge

    Please visit our website for pricing details.

    Thanks!

    ReplyDelete
  48. PCMag‘s benchmarks, which include Geekbench 5, PCMark Work 3.0, GFXBench 5, and Basemark Web, seem to show a roughly 15% improvement over the Snapdragon 888 overall in the CPU department, a bit short of the 20% claimed by Qualcomm.
    Click here for Article
    Click Here For website

    ReplyDelete
  49. what color led light helps you sleep? ... A red light color is best for sleep because it has a low color temperature, far lower than regular sunlight.

    ReplyDelete
  50. Bilgisayarınızda veya dizüstü bilgisayarınızda en iyi ve yüksek kaliteli ekran görüntülerini almanın ardındaki sır nedir? Ekran görüntüsü alırken herhangi bir sorunla mı karşılaşıyorsunuz ve bir laptop ve PC bilgisayarda ekran görüntüsü almanın kolay bir yolunu mu arıyorsunuz?
    bilgisayarda ekran görüntüsü alma kısayolu


    ReplyDelete
  51. We are looking for an informative post it is very helpful thanks for sharing it. We are offering all types of leather jackets with worldwide free shipping.
    VARSITY JACKET MENS
    BLACK LEATHER JACKET
    HARLEY DAVIDSON JACKETS

    ReplyDelete
  52. Great content, I just go through your blogs daily. If you want to reach your customer easily just go for bulk sms india, we provides different kind of Bulk SMS services Without DLT | Free SMS API | Free Registration, one of the most effective, reliable and cost-effective ways to establish your businesses. It allows you to get a higher income and get a customer easily. Rat SMS is the most popular leading company who provides the best sms api Services.
    You can check with also best sms service provider in india

    ReplyDelete
  53. https://www.halohook.com.au/December 30, 2021 at 11:13 PM

    Handbag hook australia was founded with the idea to create a beautiful product that would make it easier to take better care of handbags in restaurants, bars, cafés and other social environments.

    ReplyDelete
  54. Wow, fantastic blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is excellent, as well as the content!. vinilos decorativos vinilos BARTOP vinilos decorativos TIENDAS

    ReplyDelete
  55. Hi tһere, You’ve done a great ϳob. I will certainly Dig it and personally recommend it to my friends. I’m sure they’ll be benefited from this site.
    Bollywood movies, news and more
    sports updates
    Hinid shayari & urdu poetry
    latest news & Gossips

    ReplyDelete
  56. CNW Resources have a professional and enthusiastic team of foreign and local qualified education who provide subpar educational expertise and consultation to students.

    ReplyDelete
  57. The great website and information shared are also very appreciable. Batman Robin Jacket

    ReplyDelete
  58. Hello there, I'm so glad I came to your website; I really found you by accident while searching for something else.

    ReplyDelete
  59. Pretty Post! Thank you so much for sharing this good content, it was so nice to read and useful to improve my knowledge as an updated one, keep blogging.

    Python Certification Training in Electronic City

    ReplyDelete
  60. A SIP calculator is a tool that allows people to calculate and estimate returns on their SIP-based mutual fund investments. SIP has recently become one of the most popular investment solutions for Generation Y (Gen-Y) also known as Millennials. Download imperial Money app and start calculating your SIP returns.sip calculator yearly
    sip calculator yearly

    ReplyDelete
  61. Hey! I am Gregory Gladiya. I am here from the technical team to assist you in resolving the Epson printer issues.For further information on on driver install, click here: Epson ET 2760 Driver. Here you will be able to find a solution to resolve issues that are faced with Epson printers of any model.

    ReplyDelete
  62. I enjoyed over read your blog post. Your blog have nice information.
    India No.1 Media

    ReplyDelete
  63. Searching for the best weed delivery service near you! Look no further! Weedmarket420.us Delievery is one of the most trusted, professional and top-quality weed delivery services in California. Weedmarket420 Express delivers legal, dependable,quality medicinal and recreational cannabis that caters to your desires at a competitive price with FAST and friendly service.

    ReplyDelete
  64. I cant taking office on focusing long adequate to research; lots less write this rosy of article. Youve outdone your self as quickly as this cloth truely. it's miles one of the greatest contents. Gamemaker Studio 2 Desktop Crack

    ReplyDelete
  65. I go to your blog frequently and counsel it to the complete of folks who desired to feature-on happening their understanding subsequent to ease. The style of writing is exquisite and plus the content material is summit-notch. thanks for that perception you provide the readers! AVG Driver updater Crack

    ReplyDelete
  66. i'm incapable of reading articles online particularly frequently, however Im happy I did nowadays. it is selected adroitly written, and your points are adeptly-expressed. I demand you harmoniously, entertain, dont ever lower writing. Birthday Wishes For EX BoyFriend

    ReplyDelete
  67. Get your Career in IT on track with our Career Accelerator Program by Premium Learnings

    Check our Youtube channel for our training videos - https://www.youtube.com/c/PremiumLearningssystem

    For more info do visit us: https://www.premiumlearnings.com/

    ReplyDelete
  68. Hey there, You have performed an incredible job. I will certainly Digg it and for my part suggest to my friends. I am confident they’ll be benefited from this site.

    BA 1st Year Exam Result | BA 2nd Year Exam Result | BA 3rd Year Exam Result.

    ReplyDelete
  69. Mutual Fund Investment App Imperial money

    We at Imperial Money truly believe that the most Important Aspect in any business is long term relationship. We believe we are not in the money management business but for us the emotions and satisfaction of our client matter the most. Since last 8 year our every single client has been connected with us. This is a legacy not because of the returns we delivered for them but also the real comfort zone we gave them even in the most turbulent and volatile market scenario.

    ReplyDelete
  70. up forest guard exam date : उत्तर प्रदेश वन विभाग भर्ती 2022 की परीक्षा यूपीएसएसएससी के द्वारा दिसंबर 2021 में जारी की जानी थी पर कोविड-19 के कारण इस परीक्षा को पोस्टपोनड कर दिया गया | अब सभी उम्मीदवार उत्तर प्रदेश वन विभाग भर्ती 2022 ( up forest guard exam date ) की परीक्षा का काफी बेसब्री से इंतजार कर रहे हैं और इस आर्टिकल में हम आपको प्रदान करेंगे कि आप कैसे इस परीक्षा के लिए तैयारी कर सकते हैं और यह परीक्षा कौन सी तिथि को संपन्न कराई जाएगी |
    https://amartyajobs.com/2022/05/sridevi-matka-result-sridevi-night-chart-sridevi-satta-143/

    ReplyDelete
  71. IMPERIAL MONEY APP DOWNLOAD NOW
    ★ Free paperless Investment Account
    ★ Start SIP investments with as low as Rs. 100
    ★ View & Compare Top Mutual Funds by Ratings
    ★ SIP & Lump sum Tax Saving Investment Baskets to save tax up to 46,800 by investing in Tax Saving Mutual Funds
    ★ Order types include SIP, Lump sum, Switch, Redeem, STP and SWP

    ReplyDelete
  72. Thanks for sharing this piece of information. I really enjoyed it. keep up the good work.
    Buy Instagram Followers In Kerala

    ReplyDelete
  73. सट्टा किंग
    Disawer Result Today: दिल्ली से चलने वाले सट्टा मटका मार्केट (Satta Matka Market Delhi) के सबसे ..

    ReplyDelete
  74. What are the Benefits of Investing in Mutual Funds?
    ● Professional Management
    ● Asset Allocation
    ● Best Tax Saving Option
    ● Schemes for Every Financial Goal
    ● High Return on investments
    ● Easiest Form Of Investment
    ● Safety & Transparency
    ● Liquidity
    To Know More
    IMPERIAL MONEY APP Click Here To Know More

    ReplyDelete
  75. Thanks for Sharing This Article. It is very so much valuable content. Azure Data Factory Training in Hyderabad

    ReplyDelete
  76. Extremely magnificent useful article. I valued checking your article out. Extremely awesome uncover. I might want to joke this on my supporters. Much obliged!
    visit us: -swhizz
    our services: -
    Salesforce
    DevOps
    aws
    Testing
    Java

    ReplyDelete
  77. Step-by-Step Hacking Tutorials about WiFi hacking,
    Kali Linux, Metasploit, exploits, ethical hacking, information security, malware analysis and scanning
    hacking

    ReplyDelete
  78. Everyone loves it when individuals get together and share thoughts. Great blog, continue the good work!
    Web Designing Training in Bangalore
    Best Training Institute in Bangalore

    ReplyDelete
  79. Thanks for sharing this valuable information with us.
    Punk Rock Pants

    ReplyDelete
  80. Thanks for sharing this valuable information with us.
    Gothic EMO Pants

    ReplyDelete
  81. This comment has been removed by the author.

    ReplyDelete

  82. Buy NCLEX without Exam
    Buy SSN
    buy US Driver’s License

    ReplyDelete
  83. Great! this post grabs great information.

    ReplyDelete
  84. Thank you for this insightful and informative blog post! It provided valuable knowledge and a fresh perspective on the topic. Keep up the great work! Are You looking for Gummies we have best Gummsi Gummies Online Store

    ReplyDelete
  85. digital marketing course in hyderabad
    digital marketing course in telugu

    wordpress training in hyderabad
    video editing course in hyderabad

    seo training in hyderabad

    ReplyDelete
  86. Assertion rewriting in py.test is a technique introduced in version 2.1 that modifies the Abstract Syntax Tree (AST) of test modules to provide information about subexpressions when assertions fail. This blog post will provide insights into how assertion rewriting is implemented and what the rewritten tests look like.

    Before version 2.1, py.test performed assertion introspection by reinterpreting failed assertions. This involved rerunning the assertion to gather information about intermediate values. While this approach worked, it had limitations, particularly when assert statements had side effects, causing unexpected behavior due to the evaluation happening twice on failure.

    To overcome these limitations, assertion rewriting was introduced. It involves modifying the AST of the test modules. The AST represents the structure of the code and can be manipulated programmatically. By modifying the AST, py.test enhances the assert statements to gather information about subexpressions without the need for reevaluation.

    By modifying the AST, assertion rewriting allows py.test to extract valuable information about intermediate values in subexpressions when an assertion fails. This information can be used to provide more detailed error messages or to generate reports with additional context.

    The blog post promises to provide a peek into the implementation of assertion rewriting and showcases what the rewritten tests look like. It likely explains the process of modifying the AST and demonstrates how the modified assert statements provide more informative output when failures occur.

    If you're interested in learning more about the technical details and visual examples, I recommend reading the full blog post.Jobs Listings
    Visit Serafelagi.com!

    ReplyDelete
  87. Amazing Post!

    Empowering Digital Dreams: We are an innovative app development company dedicated to turning ideas into immersive and functional mobile experiences.Mobile App Development Company in Delhi | Top App Developers in Delhi With a passion for cutting-edge technology, we craft solutions that redefine user engagement and drive businesses forward.

    ReplyDelete
  88. "Great article, felt good after reading, worth it.
    i would like to read more from you.
    keep posting more.
    also follow Mern Stack course in hyderabad"

    ReplyDelete

  89. thanks for blog
    https://www.uiuxdesignschool.in/

    ReplyDelete