Komentáře •

  • @shadelmendez2392
    @shadelmendez2392 Před 3 měsíci +2

    This is the easiest and clearest explanation that i've seen so far!! It helped me immensely, thank you so much!!!

    • @python360
      @python360 Před 3 měsíci

      Thank you so much for your comment, this is really good to hear!!

  • @rosscoguitar
    @rosscoguitar Před rokem +2

    Very, very good explanation. You did a great job of explaning how mocks work, and showing their value in a very practical way. Thanks!

    • @python360
      @python360 Před rokem +1

      Thank you so much 👍 hopefully disconnecting my network connection really showed their usefulness!

  • @jjones40
    @jjones40 Před 11 měsíci +2

    This can be pretty confusing for those of us starting out with mock and patch. This was really clear. Thanks. (Thumbs up, subscribed).

    • @python360
      @python360 Před 11 měsíci +1

      Thank you. I tried to keep it very focussed. Thanks for subscribing, really appreciate it 👍

  • @sebastiancontreras3300
    @sebastiancontreras3300 Před rokem +1

    Thank you man! Nice domain of the subject

    • @python360
      @python360 Před rokem

      Thanks man! That means a lot to me 🙂👍

  • @paracha3
    @paracha3 Před rokem +4

    Good to learn from "Jean Claude Van Damme" :) On serious note , please post more pytest, you method of teaching is v good.

    • @python360
      @python360 Před rokem

      Thank you!! Will do more Pytest as requested 👍👍

  • @corybilyeu4490
    @corybilyeu4490 Před 2 měsíci +1

    Hi when running the tests I get error "modulenotfounderror no module named app" . I know there is something wrong with the relative imports? but I followed your structure exactly

    • @python360
      @python360 Před 2 měsíci

      ah ok, are you on windows or Linux/mac ?

    • @python360
      @python360 Před 2 měsíci

      try : python3.10 -m pytest
      see also : github.com/RGGH/mok
      clone it and see it it works?

  • @amitsahni1071
    @amitsahni1071 Před rokem +1

    Thank You so much

    • @python360
      @python360 Před rokem +1

      Thank you! + Let me know if you would like a future video on a specific topic 👍

    • @amitsahni1071
      @amitsahni1071 Před rokem +1

      @@python360 ya definitely, I will let u know. Thank u🙂

  • @nikhilknair39
    @nikhilknair39 Před rokem +1

    thank you so much..🙂

    • @python360
      @python360 Před rokem

      Thank you for the nice feedback 👍

  • @thongtranquoc3427
    @thongtranquoc3427 Před 10 měsíci +1

    When I enter this line: "from app.fetch_www import parse".
    It shows the error: Import "app.fetch_www"cannot be resolved. Pylance (reportMissingImports).
    Do you know how to fix?

    • @python360
      @python360 Před 10 měsíci

      Hi, yes, so that was my particular set up, so to do the same you will need a directory called "app" and then have "fetch_www.py" inside it. If you're using VS Ccode, when you start the imports at the top of your python file, the autocomplete should offer you the completion of the correct filepath.
      If your directory structure is different try . or .. before the file you want to import (and leave off the .py ) when you write the import at the top of the file.
      ps. from app.fetch_www import parse ~ Those are MY file names, not standard library, so you'll need to replicate what I coded if you haven't done so.
      Cheers
      Dr Pi.

  • @nikosgeorgantas2481
    @nikosgeorgantas2481 Před 11 měsíci +1

    How do we test a function that needs arguments with this method ?

    • @python360
      @python360 Před 11 měsíci

      I made a gist : gist.github.com/RGGH/557b9e9ee710242b48f9503f0141e058
      Hope this answers?!

  • @corybilyeu4490
    @corybilyeu4490 Před 2 měsíci +1

    since app is one directory up from tests/test_bcd.py, how can you import it such as from app.fetch_www import parse?
    This would need to go one directory up first?

    • @python360
      @python360 Před 2 měsíci

      .
      ├── app
      │ └── fetch_www.py
      └── tests
      └── test_bcd.py
      have you got the structure as above? (have you got tree installed, it's great for this kind of stuff)

    • @mytrustysteed8476
      @mytrustysteed8476 Před 2 měsíci

      Yes just like this.. even added __init__.py files in app/ and tests/
      Been banging my head on this one. I'm working on a mac in vs code

    • @python360
      @python360 Před 2 měsíci

      I typed it all back in as I'd not kept the project, I tested it and it works ok : github.com/RGGH/mok
      One tip : specify your python version if you are doing it from command line : eg :
      $python3.10 -m pytest

    • @mytrustysteed8476
      @mytrustysteed8476 Před 2 měsíci +1

      @@python360 I saw this in the repo
      Add the project root directory to the PYTHONPATH
      # Replace '/home/rag/Documents/python/mok
      I didn't do this, that could be it no?

    • @python360
      @python360 Před 2 měsíci

      @@mytrustysteed8476 Yes, PATH can be a problem - if you use "python3.10 -m pytest" or whatever version of python you use then this should work.
      You can run "which python" and "which pytest" from terminal to check the paths..
      See this : g.co/gemini/share/b76c08a4f516
      PATH is a pain, but as it works on my set up then, check PATH, make sure you have __init__.py and also you can drag the file icon from VSCode file explorer, and hold down shift and drop it in between quotes when trying to get the right path into your python code.

  • @kirubababu9255
    @kirubababu9255 Před 8 měsíci

    I am getting attribute error for the file path

    • @python360
      @python360 Před 8 měsíci

      are you using windows or Linux/mac?

  • @thedinosham
    @thedinosham Před rokem +2

    You just mocked the thumbnail !

    • @python360
      @python360 Před rokem

      yes....what a mock up! 😉

  • @paulosantana9607
    @paulosantana9607 Před rokem +1

    came because the girl, stayed because of the knowledge

    • @python360
      @python360 Před rokem

      Ah man, that's made my day! 🤭👍

  • @smjadeja4780
    @smjadeja4780 Před rokem

    theme name

  • @hypebeastuchiha9229
    @hypebeastuchiha9229 Před rokem +1

    Anime girl next time pls

  • @chobblegobbler6671
    @chobblegobbler6671 Před rokem

    The amount of style is distractful against the content!

    • @python360
      @python360 Před rokem

      Thank you. Maybe you would like to make a better video instead?