adding test == others fail??? (intermediate) anthony explains

Поділитися
Вставка
  • Опубліковано 5 вер 2024
  • today I show off a very strange bug in `black`'s testsuite -- and then how I found the problem which led to the fix!
    - what is test pollution? • finding and fixing tes...
    - fixing a flaky test with detect-test-pollution: • fix flaky tests with d...
    - debugging a sentry test pollution: • debugging a sentry tes...
    playlist: • anthony explains
    ==========
    twitch: / anthonywritescode
    dicsord: / discord
    twitter: / codewithanthony
    github: github.com/aso...
    stream github: github.com/ant...
    I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!

КОМЕНТАРІ • 14

  • @mrswats
    @mrswats 4 місяці тому +9

    Detect test pollution is such a great tool

  • @twelvethis3979
    @twelvethis3979 4 місяці тому +5

    Really great stuff again! Thanks, AnthonyI love it how you tag these videos to be "intermediate". I think this is really advanced stuff. I wouldn't have been able to figure this out and I presume 90 percent of programmers would struggle with this is as well 😅

  • @leonseled
    @leonseled 3 місяці тому +1

    Thank you for sharing your knowledge. The devil is in the details and that's something where even ChatGPT would fail at i.e. how you arrived at your solution, the way you navigated around the problem etc. Always something to learn from a master at his craft! Love how your videos are also free from fluff!

  • @SQADIqw
    @SQADIqw 10 днів тому

    Nice tools, valuable educational tips, cool vid. Thank for the production and sharing!

  • @rahul_bali
    @rahul_bali 3 місяці тому

    Do you guys also face difficulty writing tests more than the actual code ? Sometimes I don't want to write test cases at all.

  • @SQADIqw
    @SQADIqw 10 днів тому +1

    Btw, @lru_cache is not infinite, it has default value of max_size=128

  • @illiakaltovich
    @illiakaltovich 3 місяці тому +1

    Just a random comment to support this great channel

  • @spaghettiking653
    @spaghettiking653 3 місяці тому

    How does detect_test_pollution half the space every time? How does it know it can just stop considering half the tests?

    • @anthonywritescode
      @anthonywritescode  3 місяці тому +1

      if you run half the tests and it still fails then you know the other half doesn't cause the failure

  • @user-gh4lv2ub2j
    @user-gh4lv2ub2j 4 місяці тому +2

    Wait; black has a test suite???

    • @ruroruro
      @ruroruro 3 місяці тому +1

      Of course it does. It's incredibly important for an autoformatter to guarantee that it works exactly as expected, doesn't produce invalid code, doesn't change semantics, doesn't keep reformatting code back and forth, doesn't require multiple passes to reach the "fixed point", etc etc etc

    • @anthonywritescode
      @anthonywritescode  3 місяці тому +1

      imo black has not enough of a test suite

  • @greob
    @greob 3 місяці тому

    8:35 tests on filesystem are most of the time setup in /tmp which is usually tmpfs, so it should be plenty fast since it’s all done in RAM, right?

    • @anthonywritescode
      @anthonywritescode  3 місяці тому +1

      not necessarily and ime not usually -- tmpfs can be any filesystem type