lorey / mlscraper

🤖 Scrape data from HTML websites automatically by just providing examples
https://pypi.org/project/mlscraper/
1.31k stars 89 forks source link

Feature/test example #28

Closed leo8198 closed 2 years ago

leo8198 commented 2 years ago

Unit test to test if the examples work using the pytest package.

I plan to add more examples in another PR.

lorey commented 2 years ago

Hi @leo8198, thank you very much for the Pull Request. That's a very good idea and a very welcome addition!

leo8198 commented 2 years ago

Thank you, @lorey !

lorey commented 2 years ago

Just a small side note: I'm not sure if you saw the tox/pre-commit configuration. It automatically takes care of testing and formatting for you. The easiest way is to install and run tox as described in CONTRIBUTING.rst before committing changes.

If you need help with your next PR, feel free to drop me a mail, I'll help :)

leo8198 commented 2 years ago

Yes, I ran the tox command after I finished my code changes and before sending the PR. Fascinating tool!

It didn't work correctly?

Thanks for the side note!

lorey commented 2 years ago

No, running tox could not work. This is because the example uses requests which is not a dependency of mlscraper, so in an isolated environment, this should not work by design. Check out the commits after your PR to see how I fixed it. But no worries, just some small additions 😄

leo8198 commented 2 years ago

Alright, thanks for the clarifications!