Anything and Something fixtures for pytest
==========================================
If you ever had to ignore a certain part of an assertion, you would end up with
this.
.. code-block:: python
import pytest
@pytest.mark.parametrize(
"obj",
[
"string",
123,
123.1,
True,
False,
[],
{},
(),
object,
object(),
type,
type(None),
None,
],
)
def test_anything(obj, Anything):
assert obj == Anything
@pytest.mark.parametrize(
"obj",
[
"string",
123,
123.1,
True,
False,
[],
{},
(),
object,
object(),
type,
type(None),
],
)
def test_something(obj, Something):
assert obj == Something
def test_nothing(Something):
assert None != Something
def test_something_special(Something):
assert object() == Something(lambda x: isinstance(x, object))
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/diefans/pytest-anything",
"name": "pytest-anything",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Oliver Berger",
"author_email": "diefans@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/02/42/d0e1b46582a25ac203e05e2dd203ec9d1af42fa917905113f3a6e26146c5/pytest-anything-0.1.4.tar.gz",
"platform": null,
"description": "Anything and Something fixtures for pytest\n==========================================\n\nIf you ever had to ignore a certain part of an assertion, you would end up with\nthis.\n\n.. code-block:: python\n\n import pytest\n\n\n @pytest.mark.parametrize(\n \"obj\",\n [\n \"string\",\n 123,\n 123.1,\n True,\n False,\n [],\n {},\n (),\n object,\n object(),\n type,\n type(None),\n None,\n ],\n )\n def test_anything(obj, Anything):\n assert obj == Anything\n\n\n @pytest.mark.parametrize(\n \"obj\",\n [\n \"string\",\n 123,\n 123.1,\n True,\n False,\n [],\n {},\n (),\n object,\n object(),\n type,\n type(None),\n ],\n )\n def test_something(obj, Something):\n assert obj == Something\n\n\n def test_nothing(Something):\n assert None != Something\n\n\n def test_something_special(Something):\n assert object() == Something(lambda x: isinstance(x, object))\n",
"bugtrack_url": null,
"license": "",
"summary": "Pytest fixtures to assert anything and something",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://gitlab.com/diefans/pytest-anything"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "06c8d54541d5a3ec93634ad625a19b67e072ccff6fd5eee5a14ce17f5a3d85b0",
"md5": "573b246a67da440c785acbe25c734f98",
"sha256": "357f86d5655bc300ef3d816a8549ab31e01420b07bdf16142753284329f4870f"
},
"downloads": -1,
"filename": "pytest_anything-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "573b246a67da440c785acbe25c734f98",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 3356,
"upload_time": "2024-01-18T10:46:27",
"upload_time_iso_8601": "2024-01-18T10:46:27.601469Z",
"url": "https://files.pythonhosted.org/packages/06/c8/d54541d5a3ec93634ad625a19b67e072ccff6fd5eee5a14ce17f5a3d85b0/pytest_anything-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0242d0e1b46582a25ac203e05e2dd203ec9d1af42fa917905113f3a6e26146c5",
"md5": "d7b2565d28c8578277af754922d3a469",
"sha256": "bf962202c02bc25dda527654ecb0c4fe938c76a09b8e28a860a38ca09bb8f6fa"
},
"downloads": -1,
"filename": "pytest-anything-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "d7b2565d28c8578277af754922d3a469",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 3522,
"upload_time": "2024-01-18T10:46:18",
"upload_time_iso_8601": "2024-01-18T10:46:18.364515Z",
"url": "https://files.pythonhosted.org/packages/02/42/d0e1b46582a25ac203e05e2dd203ec9d1af42fa917905113f3a6e26146c5/pytest-anything-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-18 10:46:18",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "diefans",
"gitlab_project": "pytest-anything",
"lcname": "pytest-anything"
}