Skip to main content

Test objects which pass equality checks with other objects

Project description

h-matchers

Test objects which pass equality checks with other objects

Usage

from h_matchers import Any
import re

assert [1, ValueError(), print] == [
        Any(),
        Any.instance_of(ValueError),
        Any.function()
    ]

assert ["easy", "string", "matching"] == [
        Any.string(),
        Any.string.containing("in"),
        Any.string.matching('^.*CHING!', re.IGNORECASE)
    ]

Hacking

Installing h-matchers in a development environment

You will need

  • Git

  • pyenv Follow the instructions in the pyenv README to install it. The Homebrew method works best on macOS. On Ubuntu follow the Basic GitHub Checkout method.

Clone the git repo

git clone https://github.com/hypothesis/h-matchers.git

This will download the code into a h-matchers directory in your current working directory. You need to be in the h-matchers directory for the rest of the installation process:

cd h-matchers

Run the tests

make test

That's it! You’ve finished setting up your h-matchers development environment. Run make help to see all the commands that're available for linting, code formatting, packaging, etc.

Updating the Cookiecutter scaffolding

This project was created from the https://github.com/hypothesis/h-cookiecutter-pypackage/ template. If h-cookiecutter-pypackage itself has changed since this project was created, and you want to update this project with the latest changes, you can "replay" the cookiecutter over this project. Run:

make template

This will change the files in your working tree, applying the latest updates from the h-cookiecutter-pypackage template. Inspect and test the changes, do any fixups that are needed, and then commit them to git and send a pull request.

If you want make template to skip certain files, never changing them, add these files to "options.disable_replay" in .cookiecutter.json and commit that to git.

If you want make template to update a file that's listed in disable_replay simply delete that file and then run make template, it'll recreate the file for you.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

h_matchers-1.0.20191030.155750.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

h_matchers-1.0.20191030.155750-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file h_matchers-1.0.20191030.155750.tar.gz.

File metadata

  • Download URL: h_matchers-1.0.20191030.155750.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for h_matchers-1.0.20191030.155750.tar.gz
Algorithm Hash digest
SHA256 7cf7ede51392c79324f221a802034cf9f3e5d09198f7d91f9ec9899824c38f19
MD5 cca9efd9a8ef7ff4217a55d33e70e26b
BLAKE2b-256 845bb525e554f5dc132ccb95aa61a4a13c6820d51dbf24ca0c219e77fc001023

See more details on using hashes here.

File details

Details for the file h_matchers-1.0.20191030.155750-py3-none-any.whl.

File metadata

  • Download URL: h_matchers-1.0.20191030.155750-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for h_matchers-1.0.20191030.155750-py3-none-any.whl
Algorithm Hash digest
SHA256 4cebf172e3e0091e653cba2821c71111d5e86c1aa34190c0a05d68f1605f2a65
MD5 875c2bf413931fa75075f70f9d524613
BLAKE2b-256 ee0eb86ddbd37a6ef6338b6c74d31c821eeb0abcb6da081253ae520d75542352

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page