Coder Social home page Coder Social logo

onlyanegg / ward Goto Github PK

View Code? Open in Web Editor NEW

This project forked from darrenburns/ward

0.0 1.0 0.0 7.29 MB

A modern Python test framework designed to help you find and fix flaws faster.

Home Page: https://wardpy.com/

License: MIT License

Python 98.89% Makefile 1.11%

ward's Introduction

Ward

PyPI version Gitter All Contributors

See the full documentation and feature set here.

A modern Python test framework designed to help you find and fix flaws faster.

screenshot

Features

Descriptive test names: describe what your tests do using strings, not function names.

@test("1 + 2 == 3")
def _():
    assert 1 + 2 == 3

Modular test dependencies: manage test setup/teardown code using fixtures that rely on Python's import system, not name matching.

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

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"

Parameterised testing: write a test once, and call it multiple times with different inputs

@test("truncate('{text}', num_chars={num_chars}) returns '{expected}'")
def _(
    text=s,
    num_chars=each(20, 11, 10, 5),
    expected=each(s, s, "hello w...", "he..."),
):
    result = truncate(text, num_chars)
    assert result == expected

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

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.

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

This project is currently in beta.

Planned features:

  • Smart test execution order designed to surface failures faster (using various heuristics)
  • Multi-process mode to improve performance
  • Code coverage with --coverage flag
  • Handling flaky tests with test-specific retries, timeouts
  • Plugin system

Let me know if you'd like to help out with any of these features!

Getting Started

Take a look at the "Getting Started" tutorial.

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.

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

Darren Burns
Darren Burns

๐Ÿ’ป ๐Ÿ“– ๐Ÿค” ๐Ÿ‘€ ๐Ÿ› ๐Ÿ’ก
khusrokarim
khusrokarim

๐Ÿค” ๐Ÿ’ป ๐Ÿ›
Alec Jordan
Alec Jordan

๐Ÿ’ป
Jason C. McDonald
Jason C. McDonald

๐Ÿ’ป ๐Ÿค”
Andy Kluger
Andy Kluger

๐Ÿ’ป ๐Ÿค”
thebigmunch
thebigmunch

๐Ÿ’ป
Tyler Couto
Tyler Couto

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

ward's People

Contributors

alecj avatar andydecleyre avatar codemouse92 avatar darrenburns avatar dependabot-preview[bot] avatar khusrokarim avatar thebigmunch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.