Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestDownload should allow running all tests for a given extractor #10880

Open
johnhawkinson opened this issue Oct 9, 2016 · 5 comments
Open

TestDownload should allow running all tests for a given extractor #10880

johnhawkinson opened this issue Oct 9, 2016 · 5 comments
Labels

Comments

@johnhawkinson
Copy link
Contributor

@johnhawkinson johnhawkinson commented Oct 9, 2016

Please follow the guide below

  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Feature request (request for a new functionality)

Description of your issue, suggested solution and other information

README/CONTRIBUTING explain:

  1. Run python test/test_download.py TestDownload.test_YourExtractor. This should fail at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename _TEST to _TESTS and make it into a list of dictionaries. The tests will then be named TestDownload.test_YourExtractor, TestDownload.test_YourExtractor_1, TestDownload.test_YourExtractor_2, etc.

I have to admit, I read this, wrote one test, and later on went back and added some more tests but had forgotten the final sentence. I did not at first notice that I was only running the first test, and then it took me an embarassingly long time to figure out how to run the other tests.

Why is the code structured this way — shouldn't there be an easy way to run all tests for a given extractor? That would seem to be the common case if you're working on a single extractor?

Or maybe there is a way and I'm just not seeing it?

I haven't really wrapped my head around the testing framework code, so I don't have a patch, but I am a little mystified at the current structure? Thanks. Explanation appreciated.

@yan12125 yan12125 added the request label Oct 9, 2016
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 9, 2016

That's a good idea! Useful for handling big extractors like Twitter or Facebook.

FYI: test cases are generated dynamically in test/test_download.py.

@johnhawkinson
Copy link
Contributor Author

@johnhawkinson johnhawkinson commented Feb 12, 2017

When I found myself adding tests to the Generic Extractor this morning, I wished for this. Or a way to figure out that the test I was adding was test_Generic_25. I ended up counting the number of tests and guessing, which worked OK after an initial correction, but still seemed wrong.

Were there any thoughts on the pull request?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Feb 13, 2017

Well, I just write a script to determine the ID for a given URL in generic.py.

@johnhawkinson
Copy link
Contributor Author

@johnhawkinson johnhawkinson commented Feb 13, 2017

Well, it's no good if the core maintainers have private tools to make your lives easier but the rest of us, who have less familiarity with the code, have to stumble around in the dark... :(

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Feb 13, 2017

I have quite a few shell scripts and I'll open pull requests for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.