VirtualTam's bookmarks
13 bookmarks found
Page 1 of 1
-
Python testing: unittest / pytest
2020-09-07 - https://blog.j-labs.pl/2019/02/Pytest-why-its-more-popular-than-unittest
- https://www.reddit.com/r/Python/comments/fdv5f2/pytest_or_unittest_in_2020/
- https://www.reddit.com/r/Python/comments/6s4a4p/played_with_pytest_for_the_first_time_today_uhh/
- https://www.reddit.com/r/Python/comments/5uxh22/unittest_vs_pytest/
- https://stackoverflow.com/questions/61121824/pytest-vs-unittest-framework-testloader-and-loadtestsfromtestcase-methods
- https://stackoverflow.com/questions/27954702/unittest-vs-pytest
-
Testing Flask applications with pytest
2017-05-23 - http://alexmic.net/flask-sqlalchemy-pytest/ // https://gist.github.com/alexmic/7857543
- http://piotr.banaszkiewicz.org/blog/2014/02/22/how-to-bite-flask-sqlalchemy-and-pytest-all-at-once/
- http://flask.pocoo.org/docs/0.12/testing/
- https://docs.pytest.org/en/latest/
- https://pytest-flask.readthedocs.io/en/latest/
- https://stackoverflow.com/questions/28836893/how-to-send-requests-with-jsons-in-unit-tests
-
Testinfra - test your infrastructure
2017-03-08 alternative to http://serverspec.org/tutorial.html
-
Hypothesis - property-based testing
2016-10-04 manifesto https://hypothesis.readthedocs.io/en/latest/manifesto.html code https://github.com/HypothesisWorks/hypothesis-python/ doc https://hypothesis.readthedocs.io/en/latest/index.html w/ pytest http://hypothesis.works/articles/hypothesis-pytest-fixtures/ https://developers.redhat.com/blog/2016/06/24/the-hypothesis-testing-library-for-python-an-introduction/
-
Python unit testing frameworks: Nose, Pytest
2015-02-13 Python's built-in unittest module is quite cool, but a bit limited and way too verbose (read: it's quite not easy to incite developers to write unit tests)
I'm currently looking for more dev-friendly solutions, the key points being:
- writing test code should be easy and straight-forward -keep the focus on "what to test" instead of "how to transcribe a process to a test"
- parallelization! -we, spoiled developers, should make good use of our way-too-many-cores build machines...
- complete feature set!
- we don't want to just run tests...
- coverage reports (find dead/weak/untested code sections)
- output formatting (JUnit-XML seems to be quite a common format out there)
There seem to be 3 solutions in Python:
- stock unittest + project-dependent customizations / test helpers
- nosetests
- py.test
And 2 ways of gettings things done:
- keeping things stock: no external dependency, project-specific implementation...
- using a test framework: one more module in your (test) virtualenv, more concise tests, more features (// run, code coverage, etc.)
Some links:
-
Continuous integration in Python
2014-11-27 http://ilovesymposia.com/2014/10/01/continuous-integration-0-automated-tests-with-pytest/ http://ilovesymposia.com/2014/10/02/continuous-integration-1-test-coverage/ http://ilovesymposia.com/2014/10/13/continuous-integration-in-python-3-set-up-your-test-configuration-files/ http://ilovesymposia.com/2014/10/15/continuous-integration-in-python-4-set-up-travis-ci/ http://ilovesymposia.com/2014/10/15/continuous-integration-in-python-5-report-test-coverage-using-coveralls/ http://ilovesymposia.com/2014/10/17/continuous-integration-in-python-6-show-off-your-work/ http://ilovesymposia.com/2014/10/27/continuous-integration-in-python-7-some-helper-tools-and-final-thoughts/
Page 1 of 1