Coder Social home page Coder Social logo

Improve tests about pywhat HOT 10 OPEN

 avatar commented on May 28, 2024
Improve tests

from pywhat.

Comments (10)

deepakdinesh1123 avatar deepakdinesh1123 commented on May 28, 2024

Hi, can I take this?

from pywhat.

 avatar commented on May 28, 2024

Hi, can I take this?

Apparently, there is already draft PR: #202

from pywhat.

jyooru avatar jyooru commented on May 28, 2024

Right now I'm only working on test_regex_identifier.py, so if you want you can work on some other files @deepakdinesh1123!

from pywhat.

PabloLec avatar PabloLec commented on May 28, 2024

And while we are discussing tests files, I'm not sure about the usefulness of some tests in test_click.py. We do test that all regex work in test_regex_identifier.py and #202 plans to make it easier which is great. But there is a lot of repetition in test_click.py, every regex is also tested there. Either as an arg or from the fixture file.
I added some tests myself, as I seemed to be the way it was done but I'm not sure it is useful and pretty sure it could at least be simplified.
Any thoughts? Maybe I'm just missing something.

Originally posted by @PabloLec in #206 (comment)

When #202 gets merged with examples alongside in the database, we could maybe take those, write it to a file and run the file against pyWhat to verify that regex works if match is put in a file? But we also need to test boundaryless, so matches in between of something else..

Originally posted by @amadejpapez in #206 (comment)

from pywhat.

PabloLec avatar PabloLec commented on May 28, 2024

I guess testing boundaryless and every other CLI arguments could still be made in test_click.py of course. Probably against a permanent fixture file, meaning we would not have to add every example to this fixture file.
Since everything tricky will be tested, we know the parsing part works and we could only test regex one by one with #202 method.

And we could still make a test to just iterate over all regex and respective examples and pass them as args to make sure everything works fine.

from pywhat.

Saacket avatar Saacket commented on May 28, 2024

hello

from pywhat.

jyooru avatar jyooru commented on May 28, 2024

I'm starting to work on parameterizing test_click.py now.

And we could still make a test to just iterate over all regex and respective examples and pass them as args to make sure everything works fine.

I could implement this.

from pywhat.

 avatar commented on May 28, 2024

Hey @jyooru, are you still working on click tests?

from pywhat.

jyooru avatar jyooru commented on May 28, 2024

Sorry, I forgot about this. I've cleaned up a little bit on my branch refactor/test/click.

After looking at my changes, I think that passing each regex as args is going to be a better idea than continuing to use a fixture file. This also means that each test could be automatically generated like in #202, instead of using a manually updated list that I implemented on my branch.

I'm happy to implement each regex being passed as args.

from pywhat.

 avatar commented on May 28, 2024

Sorry, I forgot about this. I've cleaned up a little bit on my branch refactor/test/click.

After looking at my changes, I think that passing each regex as args is going to be a better idea than continuing to use a fixture file. This also means that each test could be automatically generated like in #202, instead of using a manually updated list that I implemented on my branch.

I'm happy to implement each regex being passed as args.

Actually, I am thinking that regex tests should be removed from test_click.py since we already test regex database. Only CLI related tests should be left.

from pywhat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.