-
Notifications
You must be signed in to change notification settings - Fork 11
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
More efficient testing #14
Comments
Hi again! All your suggestions and recommendations about testing sounding reasonable, but I have to spend some time studying the mentioned concepts and the good practices of testing. Please feel free to contribute. Also, on this point, I want to thank you for your overall contribution and to note that your idea of adding Project Gutenberg and other book repositories is superb and from now on a high priority. I will create a new issue about it. |
What is the correct way to upgrade (using the install link in the main page seems to point/download an old version). |
I created a new issue. |
Hi
In general, test cases should be independent of real server connections.
They should run fast so that one can run them frequently during development.
Also, they shouldn't spam webpages with requests, every time a developer runs the tests.
If a test would require a server connection, use
pytest.monkeypatch
or something similar to mock it.However, having a few connection dependent test cases, which run only once before deployment, is probably a good idea.
But, for the previously mentioned reasons, they should be separated from the rest of the tests.
I suggest using
@pytest.mark.online
or something similar.Pytest marks allow you to skip specific tests if for example the option
-m "not online"
is passed.I would create a
conftest.py
file to make this behavior the default and only if a new custom--online
option is passed to pytest, the tests marked with@pytest.mark.online
are run.I can send you a merge request for that if you want.
Also, don't use copyrighted material, like Hararis "Sapiens", in your test cases, that screams for legal trouble.
On the contrary, I would love for bookcut to also support entirely legal book repositories like project gutenberg in the future, maybe even scientific publications from platforms like arxiv.
The text was updated successfully, but these errors were encountered: