ward

Ward is a modern test framework for Python with a focus on productivity and readability.

https://github.com/darrenburns/ward

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 36 committers (5.6%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.9%) to scientific vocabulary

Keywords

contributors-welcome python quality-assurance test-runner tester testing testing-framework unit-test ward

Keywords from Contributors

phase-transition asyncio molecular-dynamics gromacs lammps astronomy target-analysis pyglotaran glotaran dictionary
Last synced: 6 months ago · JSON representation

Repository

Ward is a modern test framework for Python with a focus on productivity and readability.

Basic Info
  • Host: GitHub
  • Owner: darrenburns
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage: https://ward.readthedocs.io
  • Size: 14.1 MB
Statistics
  • Stars: 1,210
  • Watchers: 12
  • Forks: 53
  • Open Issues: 51
  • Releases: 94
Archived
Topics
contributors-welcome python quality-assurance test-runner tester testing testing-framework unit-test ward
Created about 7 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Code of conduct

README.md

Codecov Documentation Status PyPI version


Ward is a Python testing framework with a focus on productivity and readability. It gives you the tools you need to write well-documented and scalable tests.

[!IMPORTANT]
I am no longer actively maintaining this project.

Ward typical test output example

Features

See the full set of features in the documentation.

Descriptive test names: describe what your tests do using strings, not function names. python @test("simple addition") # you can use markdown in these descriptions! def _(): assert 1 + 2 == 3 # you can use plain assert statements!

Modular test dependencies: manage test setup/teardown code using fixtures that rely on Python's import system, not name matching. ```python @fixture def user(): return User(name="darren")

@test("the user is called darren") def _(u=user): assert u.name == "darren" ```

Support for asyncio: define your tests and fixtures with async def and call asynchronous code within them.

```python @fixture async def user(): u = await create_user() return await u.login()

@test("the logged in user has a last session date") async def (user=user): lastsession = await getlastsessiondate(user.id) assert isrecent(lastsession, getlastsessiondate) ```

Powerful test selection: limit your test run not only by matching test names/descriptions, but also on the code contained in the body of the test. ward --search "Database.get_all_users" Or use tag expressions for more powerful filtering. ward --tags "(unit or integration) and not slow"

Parameterised testing: write a test once, and run it multiple times with different inputs by writing it in a loop. ```python for lhs, rhs, res in [ (1, 1, 2), (2, 3, 5), ]:

@test("simple addition")
def _(left=lhs, right=rhs, result=res):
    assert left + right == result

```

Cross platform: Tested on Mac OS, Linux, and Windows.

Speedy: Ward's suite of ~320 tests run in less than half a second on my machine.

Zero config: Sensible defaults mean running ward with no arguments is enough to get started. Can be configured using pyproject.toml or the command line if required.

Extendable: Ward has a plugin system built with pluggy, the same framework used by pytest.

Colourful, human readable output: quickly pinpoint and fix issues with detailed output for failing tests.

Ward failing test output example

Getting Started

Have a look at the documentation!

How to Contribute

Contributions are very welcome and encouraged!

See the contributing guide for information on how you can take part in the development of Ward.

Owner

  • Name: Darren Burns
  • Login: darrenburns
  • Kind: user
  • Location: Edinburgh, Scotland
  • Company: @monzo

Creator of a few terminal-based developer tools, open-source enjoyer, core contributor to Textual 🐍

GitHub Events

Total
  • Watch event: 13
  • Fork event: 3
Last Year
  • Watch event: 13
  • Fork event: 3

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 841
  • Total Committers: 36
  • Avg Commits per committer: 23.361
  • Development Distribution Score (DDS): 0.401
Past Year
  • Commits: 15
  • Committers: 6
  • Avg Commits per committer: 2.5
  • Development Distribution Score (DDS): 0.533
Top Committers
Name Email Commits
Darren Burns d****s@f****m 504
Darren Burns d****0@g****m 122
Darren Burns d****s@u****m 69
Josh Karpel j****l@g****m 33
Taneli Hukkinen 3****n@u****m 15
oleg.hoefling o****g@g****m 15
dependabot-preview[bot] d****]@u****m 10
dependabot[bot] 4****]@u****m 8
dependabot-preview[bot] 2****]@u****m 7
Thibaut Le Page t****p@t****t 6
pre-commit-ci[bot] 6****]@u****m 6
Josh Karpel k****l@w****u 6
Jason C. McDonald j****d@m****m 4
coutotyler c****r@g****m 4
Dorian Czichotzki d****i@o****e 3
thebigmunch m****l@t****e 3
Alexander Burchenko a****r@m****u 3
AlecJ a****n@g****m 2
Andy Kluger A****e@u****m 2
Khusro Karim k****m@f****m 2
jeduden j****n@g****m 2
Mandar Vaze m****e@g****m 1
Andreas Lutro a****o@g****m 1
Mike Cousins m****e@c****o 1
Michael Kuyper m****r@m****h 1
Alan Velasco A****A@g****m 1
Taher Chegini t****i@g****m 1
Andy Kluger a****r@g****m 1
Daniel Townsend d****n@d****k 1
Taran Lu 5****z@u****m 1
and 6 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 54
  • Total pull requests: 59
  • Average time to close issues: 2 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 27
  • Total pull request authors: 20
  • Average comments per issue: 2.24
  • Average comments per pull request: 1.46
  • Merged pull requests: 30
  • Bot issues: 0
  • Bot pull requests: 26
Past Year
  • Issues: 1
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.5
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • darrenburns (10)
  • mgzenitech (6)
  • AndydeCleyre (5)
  • JosephTLyons (4)
  • taranlu-houzz (3)
  • RamonGiovane (3)
  • hukkin (3)
  • bsa7 (2)
  • nonamethanks (2)
  • boxed (1)
  • Prof-Bloodstone (1)
  • petereon (1)
  • fabaff (1)
  • silverwind (1)
  • dantownsend (1)
Pull Request Authors
  • dependabot[bot] (21)
  • darrenburns (6)
  • pre-commit-ci[bot] (5)
  • hukkin (5)
  • AndydeCleyre (4)
  • petereon (3)
  • AABur (2)
  • vrslev (2)
  • RamonGiovane (2)
  • Forty-Bot (2)
  • taconi (1)
  • daserok (1)
  • mkuyper (1)
  • DanLipsitt (1)
  • dantownsend (1)
Top Labels
Issue Labels
enhancement (7) good first issue (7) bug (4) small (3) docs (2) idea/discussion (1)
Pull Request Labels
dependencies (21) github_actions (3) python (2)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 1,555 last-month
  • Total docker downloads: 78
  • Total dependent packages: 10
    (may contain duplicates)
  • Total dependent repositories: 58
    (may contain duplicates)
  • Total versions: 107
  • Total maintainers: 1
pypi.org: ward

A modern Python testing framework

  • Versions: 94
  • Dependent Packages: 10
  • Dependent Repositories: 58
  • Downloads: 1,555 Last month
  • Docker Downloads: 78
Rankings
Dependent packages count: 1.6%
Stargazers count: 1.9%
Dependent repos count: 1.9%
Docker downloads count: 3.0%
Average: 3.3%
Forks count: 5.6%
Downloads: 5.6%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: ward

Ward is a Python testing framework with a focus on productivity and readability. It gives you the tools you need to write well-documented and scalable tests. With Ward, you can describe your tests using strings instead of function names, and also use plain assert statements, with no need to remember assert* method names. Ward provides beautiful output that focuses on readability. It also manages test dependencies using a simple but powerful fixture system, while parameterising testing, which allows you to run a single test on multiple inputs. Ward has support for testing async code, and is supported on MacOS, Linux, and Windows. Ward is configurable with pyproject.toml, but works out-of-the-box with sensible defaults. It is also extendable via a plugin system (coming soon). Above all, Ward is speedy – Ward’s suite of ~300 tests completes in ~0.4 seconds on my machine.

  • Homepage: https://wardpy.com
  • License: MIT
  • Latest release: 0.67.0b0
    published over 3 years ago
  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 11.3%
Forks count: 23.3%
Average: 30.0%
Dependent repos count: 34.0%
Dependent packages count: 51.2%
Last synced: 6 months ago

Dependencies

.github/workflows/build.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4.0.0 composite
  • codecov/codecov-action v3 composite
  • snok/install-poetry v1.3.1 composite
.github/workflows/release.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4.0.0 composite
  • snok/install-poetry v1.3.1 composite
docs/requirements.txt pypi
  • Sphinx ==4.0.2
  • sphinx-copybutton ==0.3.1
  • sphinx-rtd-theme ==0.5.2
poetry.lock pypi
  • alabaster 0.7.13 develop
  • babel 2.11.0 develop
  • certifi 2022.12.7 develop
  • cfgv 3.3.1 develop
  • charset-normalizer 3.0.1 develop
  • coverage 5.5 develop
  • distlib 0.3.6 develop
  • docutils 0.16 develop
  • filelock 3.9.0 develop
  • identify 2.5.15 develop
  • idna 3.4 develop
  • imagesize 1.4.1 develop
  • nodeenv 1.7.0 develop
  • packaging 23.0 develop
  • platformdirs 2.6.2 develop
  • pre-commit 2.21.0 develop
  • pytz 2022.7.1 develop
  • pyyaml 6.0 develop
  • requests 2.28.2 develop
  • setuptools 66.1.1 develop
  • snowballstemmer 2.2.0 develop
  • sphinx 3.5.4 develop
  • sphinx-rtd-theme 0.5.2 develop
  • sphinxcontrib-applehelp 1.0.2 develop
  • sphinxcontrib-devhelp 1.0.2 develop
  • sphinxcontrib-htmlhelp 2.0.0 develop
  • sphinxcontrib-jsmath 1.0.1 develop
  • sphinxcontrib-qthelp 1.0.3 develop
  • sphinxcontrib-serializinghtml 1.1.5 develop
  • toml 0.10.2 develop
  • urllib3 1.26.14 develop
  • virtualenv 20.17.1 develop
  • click 8.1.3
  • click-completion 0.5.2
  • click-default-group 1.2.2
  • colorama 0.4.6
  • cucumber-tag-expressions 4.1.0
  • importlib-metadata 6.0.0
  • jinja2 3.1.2
  • markdown-it-py 2.1.0
  • markupsafe 2.1.2
  • mdurl 0.1.2
  • pluggy 1.0.0
  • pprintpp 0.4.0
  • pygments 2.14.0
  • rich 13.2.0
  • shellingham 1.5.0.post1
  • six 1.16.0
  • tomli 2.0.1
  • typing-extensions 4.4.0
  • zipp 3.11.0
pyproject.toml pypi
  • Sphinx ^3.5.1 develop
  • coverage ^5.1 develop
  • pre-commit ^2.13.0 develop
  • sphinx-rtd-theme ^0.5.1 develop
  • click >=7,<9
  • click-completion ^0.5.2
  • click-default-group ^1.2.2
  • cucumber-tag-expressions >=2.0.0,<5.0.0
  • pluggy >=0.13.1,<2.0.0
  • pprintpp ^0.4.0
  • python ^3.7.8
  • rich >=12.2.0
  • tomli >=1.0.0,<3.0.0
tests/resources/sample_test_dirs/deeply_nested/pyproject.toml pypi