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

Overview

Ward

Codecov Documentation Status PyPI version All Contributors

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

image

Features

See the full set of features in the documentation.

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"

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

@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):
    last_session = await get_last_session_date(user.id)
    assert is_recent(last_session, get_last_session_date)

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.

  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.

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.

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

💻 📖 🤔 👀 🐛 💡

khusrokarim

🤔 💻 🐛

Alec Jordan

💻

Jason C. McDonald

💻 🤔

Andy Kluger

💻 🤔

thebigmunch

💻

Tyler Couto

💻

Thibaut Le Page

💻

Dorian Czichotzki

💻 🤔

jayesh hathila

💻

Mandar Vaze

💻

Josh Karpel

💻

Andreas Lutro

💻

Oleg Höfling

💻

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

Comments
  • Add progress trackers during test execution

    Add progress trackers during test execution

    Here's a take on https://github.com/darrenburns/ward/discussions/197 , using a Rich progress bar displayed below the running tests.

    Putting this up for an early look (@darrenburns) because there are a few problems with it that might need discussion...

    • Ward's own suite is so fast that you can barely see the progress bar appear, at least on my terminal 🤪 . I've taken to adding a sleep right here so that I can actually see it while playing around...
    • It flickers pretty badly (at least on my terminal...).
    • I don't think it is compatible with either of the dots output displays, because it seems like Progress is expecting you to not print with end="" while it's running. Perhaps we can make some improvements to Rich itself to make that work better.
    opened by JoshKarpel 20
  • Add pretty output for all comparison failures

    Add pretty output for all comparison failures

    Following up on https://github.com/darrenburns/ward/pull/242 , this PR is a take on:

    • Introducing pretty output for all comparison failures, in the same titled-panel style we landed on in the other PR.
    • Introducing a consistent, extensible way to generate and combine parts of the comparison failure pretty output (it is very easy to add/change parts in the source, and should hopefully be easy to hookify it).
    • Revising the existing == output to use the titled-panel style.

    Incidentally, I extended the output to include assertion messages if present, and allowed for assertion messages that aren't plain strings.

    Here's what it looks like right now on this example: test_examples.txt:

    image

    I decided to make the two operands be displayed side-by-side to save vertical space on wide terminals. If the terminal is narrow, Rich will automatically stack them vertically instead!

    image

    opened by JoshKarpel 13
  • Add tagging separate from string descriptions

    Add tagging separate from string descriptions

    There is a clear distinction between describing a test and classifying it. They are semantically different things. The current method of 'tagging' or 'marking' tests is by patterns in the string descriptions. This not only mixes two things that probably shouldn't be but also causes some usability issues.

    Even just a couple 'tags' can drown out the test descriptions, especially since they have to be formatted for reliable parsing for text search. They don't end up looking great in the output as the tags don't line up for easy human parsing. As alluded to before, text searching is clunky at best or unreliable.

    So, I suggest adding a tags or similar attribute to tests and parameter to the test decorator to supplant the idea of tagging the descriptions. The --search CLI option could remain for text searching the descriptions, but a new --tags (or whatever name is chosen) option could be added. An implementation detail that would need to be ironed out is whether to support both 'or' and 'and' cases as well as how for multiple tags.

    enhancement idea/discussion 
    opened by thebigmunch 12
  • Add new result writers

    Add new result writers

    It might be nice to have a JSON writer if this is part of a pipeline. It might also be nice to have a non-colored output. Currently the fields are easy to see on a colored terminal, because they're different colors. However, in some cases (maybe in Jenkins) you may not have access to colors, so it'd be easier to read with clear separators and no color codes.

    enhancement idea/discussion 
    opened by onlyanegg 11
  • Ignore virtualenv folders when searching for tests? Ignore folders in .gitignore?

    Ignore virtualenv folders when searching for tests? Ignore folders in .gitignore?

    This was discovered after merging #80, which adds a Makefile which creates a venv inside the project directory. During test collection, ward recurses directories and may stumble across test modules not intended for it. Looking inside the virtualenv caused ward to fail. Running ward --path tests worked because it excluded the virtualenv from test collection.

    Screenshot 2020-01-19 at 00 56 48

    I'm wondering whether it makes sense for ward to ignore virtualenvs or folders in the .gitignore when it looks for tests?

    enhancement idea/discussion 
    opened by darrenburns 11
  • Include location footer in logs for AssertionErrors

    Include location footer in logs for AssertionErrors

    Changes:

    1. Adding Location footer in AssertionErrors.
    

    Concerns:

    1. Didn't add tests for the change as I can't find other tests for the Locations.
    2. Approach doesn't seem clean to me, not sure if how we can improve it.
    

    issue #126

    opened by jayeshathila 8
  • ditch the setup.py for a flit-flavored pyproject.toml

    ditch the setup.py for a flit-flavored pyproject.toml

    If you're interested in switching from setup.py to pyproject.toml (with flit), take a look. I thought this might be a good step toward #68.

    Notes:

    • flit looks for a project description at the start of __init__.py, so I moved it there
    • I added a dev-requirements.txt though I don't know if you want that
    • Someone with Windows would have to test if a workaround is still necessary here ("Work around encoding errors when installing on Windows." from setup.py)
    • I don't know if you want to relax the dev dependency versions, if you want to keep them at all
    opened by AndydeCleyre 8
  • Add `live` progress style and refactor output and progress styles

    Add `live` progress style and refactor output and progress styles

    Putting this up for some early feedback. Have not tested all the corner cases of #205 yet.

    @darrenburns I did what I described in #227 and it works great! I think I came up with a fairly clean way of abstracting away the actual test running while giving the styles a fair bit of control over what the output looks like. I've got the "live" output style you describe in the issue, plus a "none" output style that prints nothing, PLUS dots work with progress bars! Some of these are even a little faster in wall clock time because more of the printing is happening on a background thread.

    ... but none of them will work in CI except test-per-line output with inline progress, because the others all use Lives. In fact, since I'm always starting the live right now, it may mess up CI even with the components that would use it turned off....

    opened by JoshKarpel 7
  • Add pre-commit

    Add pre-commit

    Threw this together re: https://github.com/darrenburns/ward/discussions/214#discussioncomment-767992 , since I guess I have Opinions about which hooks to use 😛

    Depends on #217 to actually pass...

    @darrenburns if you want to use pre-commit.ci , can you opt-in at https://pre-commit.ci/ ? It should work, since this branch has a .pre-commit-config.yaml. If you don't want to use the external service, we can set up the checks as a GitHub Actions workflow.

    WIP...

    opened by JoshKarpel 7
  • Add information from tests to `ward fixtures`

    Add information from tests to `ward fixtures`

    So, this turned into a doozy. I think it's ready for a round of review.

    Addresses #159

    • Test and Fixture are now hashable. This was a little tricky for Fixture, since it seems like the underlying function's hash is different in different places (I suspect this is because they aren't actually the same function when inside the Suite because of assertion rewriting?).
    • Test now has a helper class, TestArgumentResolver, where are all of the methods that make that happen are stored. I actually didn't really need to modify them at all, although I changed how information flows through them a little and added a helper method to get fixture arguments. This made the rest of the logic a little easier for me to grok and provides an obvious place to hang more code in the future. More data could be passed to the resolver directly to lessen the amount of self.test.<whatever> going on in it.
    • ward fixtures can now display three kinds of dependency information: parent fixtures, child fixtures, and direct test usages. Parents and children can be displayed as trees.
    • Rewrote most of the fixture information display from #154 to accommodate the new functionality.
    opened by JoshKarpel 7
  • ModuleNotFoundError/ImportError within ward

    ModuleNotFoundError/ImportError within ward

    I have ward installed in a virtual environment on Python 3.7.5, and I'm getting the following error when executing the ward command in the root of my repository. My code lives in a package omission directly in this repository, and that package contains subpackages and submodules configured as tests.

    Here are the versions of the packages installed in my virtual environment:

    • GitPython-3.1.0
    • PyYAML-5.3.1
    • appdirs-1.4.3
    • bandit-1.6.2
    • click-7.1.1
    • colorama-0.3.9
    • cucumber-tag-expressions-2.0.4
    • entrypoints-0.3
    • flake8-3.7.9
    • gitdb-4.0.2
    • mccabe-0.6.1
    • pbr-5.4.4
    • pprintpp-0.4.0
    • pycodestyle-2.5.0
    • pyflakes-2.1.1
    • pygments-2.6.1
    • pyside2-5.14.1
    • shiboken2-5.14.1
    • six-1.14.0
    • smmap-3.0.1
    • stevedore-1.32.0
    • termcolor-1.1.0
    • toml-0.9.6
    • ward-0.42.0b0

    Here's the error I'm encountering:

    (venv) [email protected]:omission$ ward
    Traceback (most recent call last):
      File "/home/jason/Code/Repositories/omission/venv/bin/ward", line 10, in <module>
        sys.exit(run())
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
        rv = self.invoke(ctx)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
        return f(get_current_context(), *args, **kwargs)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/run.py", line 115, in run
        modules = list(load_modules(mod_infos))
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/collect.py", line 109, in load_modules
        m.__loader__.exec_module(m)
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "venv/lib/python3.7/site-packages/git/test/test_diff.py", line 7, in <module>
        import ddt
    ModuleNotFoundError: No module named 'ddt'
    

    After installing ddt manually (ddt-1.3.1), I get this error instead when running ward:

    Traceback (most recent call last):
      File "/home/jason/Code/Repositories/omission/venv/bin/ward", line 10, in <module>
        sys.exit(run())
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
        rv = self.invoke(ctx)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
        return f(get_current_context(), *args, **kwargs)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/run.py", line 115, in run
        modules = list(load_modules(mod_infos))
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/collect.py", line 109, in load_modules
        m.__loader__.exec_module(m)
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "venv/lib/python3.7/site-packages/git/test/performance/test_commit.py", line 11, in <module>
        from .lib import TestBigRepoRW
    ImportError: attempted relative import with no known parent package
    

    Interestingly, if I install pytest as well, the error on ward changes yet again:

    Traceback (most recent call last):
      File "/home/jason/Code/Repositories/omission/venv/bin/ward", line 10, in <module>
        sys.exit(run())
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
        rv = self.invoke(ctx)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
        return f(get_current_context(), *args, **kwargs)
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/run.py", line 115, in run
        modules = list(load_modules(mod_infos))
      File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/collect.py", line 109, in load_modules
        m.__loader__.exec_module(m)
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "venv/lib/python3.7/site-packages/importlib_metadata/tests/test_api.py", line 5, in <module>
        from . import fixtures
    ImportError: attempted relative import with no known parent package
    

    For the record, installing pytest as well installs the following:

    • attrs-19.3.0
    • importlib-metadata-1.6.0
    • more-itertools-8.2.0
    • packaging-20.3
    • pluggy-0.13.1
    • py-1.8.1
    • pyparsing-2.4.6
    • pytest-5.4.1
    • wcwidth-0.1.9
    • zipp-3.1.0
    bug 
    opened by CodeMouse92 7
  • Request: relax upper bounds on dependency: rich

    Request: relax upper bounds on dependency: rich

    This may be something to think about for more than just rich, but rich in particular is:

    1. seeing rapid development and releases
    2. used by a whole lot of projects (which may be co-installed with ward)

    Currently ward prohibits installation of the newest rich releases, which means if a project is requiring that new version of rich, an older version of ward must be used, which doesn't restrict the rich version as much.

    But this doesn't actually improve compatibility -- in fact it creates a cascading effect of installing/requiring older versions of more tools, increasing probability of in-practice incompatibility (as opposed to explicitly version-specified incompatibility) between new PyPI releases and very old ones.

    See also:

    • #323
    • https://github.com/darrenburns/ward/issues/300#issuecomment-1371304154
    opened by AndydeCleyre 0
  • Bump actions/setup-python from 4.0.0 to 4.4.0

    Bump actions/setup-python from 4.0.0 to 4.4.0

    Bumps actions/setup-python from 4.0.0 to 4.4.0.

    Release notes

    Sourced from actions/setup-python's releases.

    Add support to install multiple python versions

    In scope of this release we added support to install multiple python versions. For this you can try to use this snippet:

        - uses: actions/[email protected]
          with:
            python-version: |
                3.8
                3.9
                3.10
    

    Besides, we changed logic with throwing the error for GHES if cache is unavailable to warn (actions/setup-python#566).

    Improve error handling and messages

    In scope of this release we added improved error message to put operating system and its version in the logs (actions/setup-python#559). Besides, the release

    v4.3.0

    • Update @​actions/core to 1.10.0 version #517
    • Update @​actions/cache to 3.0.4 version #499
    • Only use github.token on github.com #443
    • Improvement of documentation #477 #479 #491 #492

    Add check-latest input and bug fixes

    In scope of this release we add the check-latest input. If check-latest is set to true, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, the version will then be downloaded from python-versions repository. By default check-latest is set to false. For PyPy it will to try to reach https://downloads.python.org/pypy/versions.json

    Example of usage:

    steps:
      - uses: actions/[email protected]
      - uses: actions/[email protected]
        with:
          python-version: '3.9'
          check-latest: true
      - run: python --version
    

    Besides, it includes such changes as

    v4.1.0

    In scope of this pull request we updated actions/cache package as the new version contains fixes for caching error handling. Moreover, we added a new input update-environment. This option allows to specify if the action shall update environment variables (default) or not.

    Update-environment input

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 1
  • Bump certifi from 2021.10.8 to 2022.12.7

    Bump certifi from 2021.10.8 to 2022.12.7

    Bumps certifi from 2021.10.8 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies python 
    opened by dependabot[bot] 1
  • Improve type hints on main functions

    Improve type hints on main functions

    Currently type information in API is not complete. It makes it hard to use the library with mypy's strict mode and Pyright.

    Also see: https://github.com/darrenburns/ward/issues/261#issuecomment-1301968435

    opened by vrslev 0
  • make async library configurable with support for asyncio/curio/trio

    make async library configurable with support for asyncio/curio/trio

    This merge request adds support to run tests using an async library other than the standard asyncio. This can be configured globally for all tests by setting async-library in the project's pyproject.toml or per test by setting async_library in the test decorator.
    Example: @test('my test that uses curio', async_library="curio")

    opened by logileifs 1
  • [Feature request] Support Curio, trio or other async libraries

    [Feature request] Support Curio, trio or other async libraries

    Would you be willing to add support for Curio and/or Trio? I would submit a PR myself but I see in https://github.com/darrenburns/ward/blob/master/ward/testing.py#L200 that asyncio.run(coro) is hardcoded and I'm not sure how you would go about to make that configurable. If you could check on the user supplied config before calling asyncio.run(coro) you could do something like:

    if self.is_async_test:
        coro = self.fn(**resolved_args)
        if config.asynclib == 'curio':
            import curio
            curio.run(coro)
        elif config.asynclib == 'trio':
            import trio
            trio.run(coro)
        else:
            asyncio.run(coro)
    else:
        self.fn(**resolved_args)
    
    opened by logileifs 1
Releases(release/0.67.0b0)
  • release/0.67.0b0(Nov 3, 2022)

    What's Changed

    • Bump actions/setup-python from 3.1.2 to 4.0.0 by @dependabot in https://github.com/darrenburns/ward/pull/336
    • use asyncio.run by @dantownsend in https://github.com/darrenburns/ward/pull/334
    • [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/darrenburns/ward/pull/337
    • Only re-indent after rewriting asserts in Py <3.11 by @AndydeCleyre in https://github.com/darrenburns/ward/pull/353
    • Add Py 3.11 to test matrix by @AndydeCleyre in https://github.com/darrenburns/ward/pull/354

    New Contributors

    • @dantownsend made their first contribution in https://github.com/darrenburns/ward/pull/334

    Full Changelog: https://github.com/darrenburns/ward/compare/release/0.66.1b0...release/0.67.0b0

    Source code(tar.gz)
    Source code(zip)
  • release/0.66.1b0(Jun 12, 2022)

    What's Changed

    • Plugin config bug fix by @petereon in https://github.com/darrenburns/ward/pull/331
    • Remove some unused 3.6-only code/checks by @darrenburns in https://github.com/darrenburns/ward/pull/326

    New Contributors

    • @petereon made their first contribution in https://github.com/darrenburns/ward/pull/331

    Full Changelog: https://github.com/darrenburns/ward/compare/release/0.66.0b0...release/0.66.1b0

    Source code(tar.gz)
    Source code(zip)
  • release/0.66.0b0(Apr 11, 2022)

    What's Changed

    • Add entry_point to satisfy conda-build by @cheginit in https://github.com/darrenburns/ward/pull/305
    • Allow Tomli v2 by @hukkin in https://github.com/darrenburns/ward/pull/311
    • Bump actions/setup-python from 2 to 3.1.0 by @dependabot in https://github.com/darrenburns/ward/pull/322
    • Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/darrenburns/ward/pull/318
    • Fix 323: Update rich dep version by @taranlu-houzz in https://github.com/darrenburns/ward/pull/324
    • Bump snok/install-poetry from 1.2.1 to 1.3.1 by @dependabot in https://github.com/darrenburns/ward/pull/316
    • Bump actions/setup-python from 3.1.0 to 3.1.2 by @dependabot in https://github.com/darrenburns/ward/pull/325
    • ci: change codecov upload from bash to codecov-action by @AABur in https://github.com/darrenburns/ward/pull/307
    • Add versions to mypy hook's additional dependencies by @mcous in https://github.com/darrenburns/ward/pull/321

    New Contributors

    • @cheginit made their first contribution in https://github.com/darrenburns/ward/pull/305
    • @taranlu-houzz made their first contribution in https://github.com/darrenburns/ward/pull/324
    • @mcous made their first contribution in https://github.com/darrenburns/ward/pull/321

    Full Changelog: https://github.com/darrenburns/ward/compare/release/0.65.0b0...release/0.66.0b0

    Source code(tar.gz)
    Source code(zip)
  • release/0.65.0b0(Oct 8, 2021)

    What's Changed

    • [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/darrenburns/ward/pull/287
    • Bump snok/install-poetry from 1.1.6 to 1.2.1 by @dependabot in https://github.com/darrenburns/ward/pull/299
    • Fixture teardown improvements - output is now captured correctly by @darrenburns in https://github.com/darrenburns/ward/pull/303

    Full Changelog: https://github.com/darrenburns/ward/compare/release/0.64.0b0...release/0.65.0b0

    Source code(tar.gz)
    Source code(zip)
  • release/0.64.0b0(Oct 7, 2021)

    What's Changed

    • Strict keys in config file - invalid config keys will cause error now by @hukkin in https://github.com/darrenburns/ward/pull/292
    • Tear-down exception handling by @mkuyper in https://github.com/darrenburns/ward/pull/293
    • Allow up-to-date dataclasses, cucumber-tag-expressions and pluggy by @hukkin in https://github.com/darrenburns/ward/pull/295
    • Type check tests by @hukkin in https://github.com/darrenburns/ward/pull/294
    • Remove needless enumerate by @hukkin in https://github.com/darrenburns/ward/pull/296
    • Switch from 3.10 beta to 3.10 release by @darrenburns in https://github.com/darrenburns/ward/pull/302

    New Contributors

    • @mkuyper made their first contribution in https://github.com/darrenburns/ward/pull/293

    Full Changelog: https://github.com/darrenburns/ward/compare/release/0.63.0b0...release/0.64.0b0

    Source code(tar.gz)
    Source code(zip)
  • release/0.63.0b0(Jul 9, 2021)

    • Type hints for Ward are now distributed: via https://github.com/darrenburns/ward/pull/283 and several other PRs (thanks to @hukkin)
    • Every type of assertion failure now results in specialised output showing LHS and RHS values. The assertion message is now also displayed in test output (thanks to @JoshKarpel)

    image

    Source code(tar.gz)
    Source code(zip)
  • release/0.62.1b0(Jun 28, 2021)

  • release/0.62.0b0(Jun 25, 2021)

    • https://github.com/darrenburns/ward/pull/279 - Allow subclasses of specified exception class to pass raises assertion (thanks @jeduden)
    • Adds additional type hints to various modules, enables mypy in them (thanks @hukkin)
    Source code(tar.gz)
    Source code(zip)
  • release/0.61.1b0(Jun 11, 2021)

  • release/0.61.0b0(Jun 10, 2021)

    • Switch from toml to tomli to support TOML spec v1.0, and speed up parsing.
    • Small internal change to diffing to support type annotation improvements.

    Thanks to @hukkin for these changes!

    Source code(tar.gz)
    Source code(zip)
  • release/0.60.1b0(Jun 8, 2021)

  • release/0.60.0b0(Jun 5, 2021)

    • Performance improvement to shave ~15% off of test suite run times
    • Adds live output style
    • Add pretty comparison info for in/not in assertion failures

    live output

    live_output

    Assertion info for in/not in

    image

    All of these changes were contributed by @JoshKarpel!

    Source code(tar.gz)
    Source code(zip)
  • release/0.59.0b0(May 30, 2021)

    Ward now outputs diffs using Rich when when an equality check in an assert fails within a test.

    This let us remove the final pieces of colorama and termcolor code from Ward.

    Source code(tar.gz)
    Source code(zip)
  • release/0.58.0b0(May 30, 2021)

    • Fixes #140
    • Fixes #239
    • Fixes issue where pyproject.toml defaults were not being applied
    • Fixes issue with dots-module output where it wouldn't display properly if you were in a directory deeper than a running test module.
    • Changes --exclude to work with paths instead of globs.
    • No longer modify sys.modules during collection phase.
    • Fix module.__package__ being set incorrectly in some cases.
    • Fix issue where exclude defined in pyproject.toml was not interacting with CLI supplied --paths correctly.
    • Changes some semantics around running ward with no --path: it now means "run all tests in my project". If you want to get specific, supply a path. If we can't find the project, then running ward is the same as ward --path ..
    Source code(tar.gz)
    Source code(zip)
  • release/0.57.2b0(May 25, 2021)

  • release/0.57.1b0(May 24, 2021)

  • release/0.57.0b0(May 24, 2021)

    Adds initial support for plugins using Pluggy. In this release, 3 hooks are available: before_session, after_session, and preprocess_tests.

    Source code(tar.gz)
    Source code(zip)
  • release/0.56.0b0(May 20, 2021)

    • Upgrades Ward to use Click v8 thanks to @AABur.
    • Splits some modules into internal/public, adds docs on some public APIs, more selectively exposes functionality to users.
    Source code(tar.gz)
    Source code(zip)
  • release/0.55.0b0(May 15, 2021)

    Adds --progress-style [inline|bar] % progress through test session to output (enabled by default).

    inline

    image

    bar

    image

    Thanks again to @JoshKarpel for this contribution 🎉

    Source code(tar.gz)
    Source code(zip)
  • release/0.54.0b0(Apr 2, 2021)

    Adds when param to @skip and @xfail decorators, allowing you to only apply them when some boolean or Callable predicate holds. e.g.

    @skip("Skipped on Windows", when=platform.system() == "Windows")
    @test("_build_package_name constructs package name '{pkg}' from '{path}'")
    def _(
        pkg=each("", "foo", "foo.bar"),
        path=each("foo.py", "foo/bar.py", "foo/bar/baz.py"),
    ):
        m = ModuleType(name="")
        m.__file__ = path
        assert _build_package_name(m) == pkg
    
    
    @skip("Skipped on Unix", when=platform.system() != "Windows")
    @test("_build_package_name constructs package name '{pkg}' from '{path}'")
    def _(
        pkg=each("", "foo", "foo.bar"),
        path=each("foo.py", "foo\\bar.py", "foo\\bar\\baz.py"),
    ):
        m = ModuleType(name="")
        m.__file__ = path
        assert _build_package_name(m) == pkg
    

    When run on a non-Windows system:

    image Source code(tar.gz)
    Source code(zip)
  • release/0.53.0b0(Apr 2, 2021)

  • release/0.52.1b0(Apr 2, 2021)

  • release/0.52.0b0(Mar 22, 2021)

  • release/0.51.2b0(Mar 21, 2021)

  • release/0.51.1b0(Mar 21, 2021)

  • release/0.51.0b0(Mar 19, 2021)

    ward fixtures allows you to find test fixture dependencies and unused fixtures in your project by printing out

    The ward fixtures --show-dependency-trees command now uses the Tree class from Rich to construct it's output:

    image

    The standard ward fixtures command which simply lists all fixtures that Ward is able to find in a project now also uses Rich for output:

    image

    Contribution by @JoshKarpel Rich: https://github.com/willmcgugan/rich/

    Source code(tar.gz)
    Source code(zip)
  • release/0.50.0b0(Feb 19, 2021)

  • release/0.49.0b0(Feb 19, 2021)

  • release/0.48.0b0(Jul 10, 2020)

    Refactor and improvements to ward fixtures output, which allows you to view information about fixtures in your project and the tests that use them. Thanks @JoshKarpel!

    Screenshot 2020-07-10 at 16 31 27 Source code(tar.gz)
    Source code(zip)
  • release/0.47.0b0(Jun 4, 2020)

    • Exiting during a test or fixture will trigger a failure #165
    • Bump toml to 0.10.0 #164
    • Add coverage reporting with Codecov #167

    Thanks @hoefling and @JoshKarpel!

    Source code(tar.gz)
    Source code(zip)
Owner
Darren Burns
Pythonista @fanduel 🐍
Darren Burns
d4rk Ghost is all in one hacking framework For red team Pentesting

d4rk ghost is all in one Hacking framework For red team Pentesting it contains all modules , information_gathering exploitation + vulnerability scanning + ddos attacks with 12 methods + proxy scraper

d4rk sh4d0w 15 Dec 15, 2022
A Modular Penetration Testing Framework

fsociety A Modular Penetration Testing Framework Install pip install fsociety Update pip install --upgrade fsociety Usage usage: fsociety [-h] [-i] [-

fsociety-team 802 Dec 31, 2022
Test utility for validating OpenAPI documentation

DRF OpenAPI Tester This is a test utility to validate DRF Test Responses against OpenAPI 2 and 3 schema. It has built-in support for: OpenAPI 2/3 yaml

snok 103 Dec 21, 2022
Python drivers for YeeNet firmware

yeenet-router-driver-python Python drivers for YeeNet firmware This repo is under heavy development. Many or all of these scripts are not likely to wo

Jason Paximadas 1 Dec 26, 2021
nose is nicer testing for python

On some platforms, brp-compress zips man pages without distutils knowing about it. This results in an error when building an rpm for nose. The rpm bui

1.4k Dec 12, 2022
Object factory for Django

Model Bakery: Smart fixtures for better tests Model Bakery offers you a smart way to create fixtures for testing in Django. With a simple and powerful

Model Bakers 632 Jan 08, 2023
API mocking with Python.

apyr apyr (all lowercase) is a simple & easy to use mock API server. It's great for front-end development when your API is not ready, or when you are

Umut Seven 55 Nov 25, 2022
Python Rest Testing

pyresttest Table of Contents What Is It? Status Installation Sample Test Examples Installation How Do I Use It? Running A Simple Test Using JSON Valid

Sam Van Oort 1.1k Dec 28, 2022
How to Create a YouTube Bot that Increases Views using Python Programming Language

YouTube-Bot-in-Python-Selenium How to Create a YouTube Bot that Increases Views using Python Programming Language. The app is for educational purpose

Edna 14 Jan 03, 2023
Simple assertion library for unit testing in python with a fluent API

assertpy Simple assertions library for unit testing in Python with a nice fluent API. Supports both Python 2 and 3. Usage Just import the assert_that

19 Sep 10, 2022
🐍 Material for PyData Global 2021 Presentation: Effective Testing for Machine Learning Projects

Effective Testing for Machine Learning Projects Code for PyData Global 2021 Presentation by @edublancas. Slides available here. The project is develop

Eduardo Blancas 73 Nov 06, 2022
The async ready version of the AniManga library created by centipede000.

Async-Animanga An Async/Aiohttp compatible library. Async-Animanga is an async ready web scraping library that returns Manga information from animepla

3 Sep 22, 2022
A Library for Working with Sauce Labs

Robotframework - Sauce Labs Plugin This is a plugin for the SeleniumLibrary to help with using Sauce Labs. This library is a plugin extension of the S

joshin4colours 6 Oct 12, 2021
🏃💨 For when you need to fill out feedback in the last minute.

BMSCE Auto Feedback For when you need to fill out feedback in the last minute. 🏃 💨 Setup Clone the repository Run pip install selenium Set the RATIN

Shaan Subbaiah 10 May 23, 2022
A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.

PyAutoGUI PyAutoGUI is a cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard. pip inst

Al Sweigart 7.5k Dec 31, 2022
Selects tests affected by changed files. Continous test runner when used with pytest-watch.

This is a pytest plug-in which automatically selects and re-executes only tests affected by recent changes. How is this possible in dynamic language l

Tibor Arpas 614 Dec 30, 2022
Code coverage measurement for Python

Coverage.py Code coverage testing for Python. Coverage.py measures code coverage, typically during test execution. It uses the code analysis tools and

Ned Batchelder 2.3k Jan 04, 2023
Pymox - open source mock object framework for Python

Pymox is an open source mock object framework for Python. First Steps Installation Tutorial Documentation http://pymox.readthedocs.io/en/latest/index.

Ivan Rocha 7 Feb 02, 2022
Pytest support for asyncio.

pytest-asyncio: pytest support for asyncio pytest-asyncio is an Apache2 licensed library, written in Python, for testing asyncio code with pytest. asy

pytest-dev 1.1k Jan 02, 2023
Nokia SR OS automation

Nokia SR OS automation Nokia is one of the biggest vendors of the telecommunication equipment, which is very popular in the Service Provider segment.

Karneliuk.com 7 Jul 23, 2022