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

More efficient testing #14

Open
DerPhysikeR opened this issue Jun 6, 2021 · 3 comments · Fixed by #16
Open

More efficient testing #14

DerPhysikeR opened this issue Jun 6, 2021 · 3 comments · Fixed by #16
Labels
help wanted Extra attention is needed

Comments

@DerPhysikeR
Copy link
Contributor

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.

@costis94
Copy link
Owner

costis94 commented Jun 6, 2021

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.

@costis94 costis94 added the help wanted Extra attention is needed label Jun 6, 2021
@DerPhysikeR DerPhysikeR mentioned this issue Jun 6, 2021
@costis94 costis94 reopened this Jun 7, 2021
@DarrenPIngram
Copy link

What is the correct way to upgrade (using the install link in the main page seems to point/download an old version).
I am stuck on 1.3.3

@costis94
Copy link
Owner

What is the correct way to upgrade (using the install link in the main page seems to point/download an old version).
I am stuck on 1.3.3

I created a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants