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

Improved testing and update readme / docs #45

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Nachtalb
Copy link
Contributor

@Nachtalb Nachtalb commented Feb 27, 2020

This PR basically introduces a new way of writing tests. Instead of a single file at the project root, we use pythons unittest lib (in this case unittest2 because we want the same support for py2.7 and py3.6).

Additionally, I fixed a view things with the setup.py and the documentation.

  • setup.py should not import anything from the project itself because it leads to errors like not being able to use python setup.py install/develop because it tries to import requests which it would install with either of the said commands.
  • We are missing requirements. The sphinx requirements to build the documentation were nowhere to be found. Just saw there is a Pipfile. Thus, I added an extra (docs) which installs the required packages for us.
  • For development, we should install unittests2 so we can run the tests.
  • I updated the documentation with the new and simpler installation method and extended it with additional info about usage of the documentation itself.

Your intent of importing the version from your package was probably so that you won't forget to update the version string somewhere without noticing. For that, I wholeheartedly recommend zest.releaser https://pypi.org/project/zest.releaser/. This package makes life as a developer easy by removing the whole hassle of releasing stuff.
Before you release a package you can run longtest to check if the readme and changelog markup is correct and then you run fullrelease which does the whole release pipeline.

  • Prerelease, changes like updating version strings, changelog release date
  • Release, uploading the package to PyPI etc
  • Postrelease, setting the version and changelog back to a development state

"subTest" used in "test_all_sites" is not available in py2 unittest so
we use unittest2 instead.
@Nachtalb Nachtalb force-pushed the na/improved-testing branch 7 times, most recently from 1c4dfb6 to 187f612 Compare February 27, 2020 02:39
@Nachtalb
Copy link
Contributor Author

@LuqueDaniel Do you know how to fix the travis / appveyor stuff. One problem is that pylint returns exit code 30 which by both systems count as fail. And then the differences between the OSX and Linux machines on travis.

@LuqueDaniel
Copy link
Owner

LuqueDaniel commented Feb 27, 2020

@Nachtalb First of all thank you very much for your contribution. A few weeks ago I added pylint as a linter, but I still have to configure it so that it isn't so strict. Sorry for the inconvenience.

README.md Show resolved Hide resolved
@LuqueDaniel
Copy link
Owner

AppVeyor and Travis settings fixed.



class TestApiClients(TestCase):
client_mapping = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #44 changes have been merged. Adds lolibooru too.

@LuqueDaniel
Copy link
Owner

I didn't know zest.releaser I really like the idea. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants