{"id":13813906,"url":"https://github.com/dropbox/dbx-unittest2pytest","last_synced_at":"2025-07-21T12:32:23.754Z","repository":{"id":62567124,"uuid":"50752218","full_name":"dropbox/dbx-unittest2pytest","owner":"dropbox","description":"Convert unittest asserts to pytest rewritten asserts.","archived":false,"fork":false,"pushed_at":"2023-05-09T21:42:59.000Z","size":25,"stargazers_count":28,"open_issues_count":4,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-12T18:04:51.189Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dropbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-31T00:40:58.000Z","updated_at":"2025-06-21T05:18:12.000Z","dependencies_parsed_at":"2024-08-04T04:04:54.094Z","dependency_job_id":null,"html_url":"https://github.com/dropbox/dbx-unittest2pytest","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dropbox/dbx-unittest2pytest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdbx-unittest2pytest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdbx-unittest2pytest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdbx-unittest2pytest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdbx-unittest2pytest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropbox","download_url":"https://codeload.github.com/dropbox/dbx-unittest2pytest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdbx-unittest2pytest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265080002,"owners_count":23708097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:01:35.506Z","updated_at":"2025-07-21T12:32:23.697Z","avatar_url":"https://github.com/dropbox.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# dbx-unittest2pytest [![Build Status](https://travis-ci.org/dropbox/dbx-unittest2pytest.svg?branch=master)](https://travis-ci.org/dropbox/dbx-unittest2pytest)\n\n## Warning: this is not the official unittest2pytest!\n\nDropbox developed this package in parallel with (what became) the official `pytest-dev` package `unittest2pytest`, that\nhas the same name and does the same thing. It's the one that has the name `unittest2pytest` on PyPI, and it can convert\na few more assertions. Check it out [on Github](https://github.com/pytest-dev/unittest2pytest) or\n[on PyPI](https://pypi.python.org/pypi/unittest2pytest). We've since renamed the project dbx-unittest2pytest to avoid confusion\n\n# Description\n\nConvert unittest asserts to pytest rewritten asserts.\n\npy.test supports advanced assertion introspection, allowing it to provide more detailed error messages.\nhttps://pytest.org/latest/assert.html#advanced-assertion-introspection\n\nCheck out this blog post detailing how it works.\nhttp://pybites.blogspot.ie/2011/07/behind-scenes-of-pytests-new-assertion.html\n\ntl;dr\nIf you are using py.test, then \"assert a == b\" is better than \"self.assertEqual(a, b)\"\n\n# What's the advantage?\n\nPytest output before:\n```\ntest/test_login.py:80: in test\n    self.assertEquals(login.call_count, 1)\nE   AssertionError: 0 != 1\n    assert login.call_count == 1\n```\nPytest output after:\n```\ntest/test_login.py:80: in test\nE   AssertionError: assert 0 == 1\nE    +  where 0 = \u003cMagicMock name='mock.desktop_login.login' id='140671857679512'\u003e.call_count\n```\n\n# What happens to my test code?\n\nBefore:\n```python\nself.assertEqual(a, b)\nself.assertEqual(a, None)\nself.assertFalse(a)\n```\nAfter:\n```python\nassert a == b\nassert a is None\nassert not a\n```\n\nSee unit tests for many more examples.\n\n# Usage\n```\ndbx-unittest2pytest --help\ndbx-unittest2pytest --fix=asserts \u003cfilename/dirnames\u003e\n```\nRun 4x parallel.\n```\ndbx-unittest2pytest --fix=asserts -j4 [filename/dirnames]\n```\nWrite back to original files.\n```\ndbx-unittest2pytest --fix=asserts -w [filename/dirnames]\n```\n\n# Contributing\nContributions are welcome. Tests can be run with [tox][tox]. Lint with [flake8][flake8]\nYou'll have to agree to Dropbox's [CLA][CLA].\n\n# Issues\nIf you encounter any problems, please [file an issue][issues] along with a detailed description.\n\n[flake8]: https://flake8.readthedocs.org/en/latest/\n[issues]: https://github.com/dropbox/dbx-unittest2pytest/issues\n[tox]: https://tox.readthedocs.org/en/latest/\n[CLA]: https://opensource.dropbox.com/cla/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Fdbx-unittest2pytest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropbox%2Fdbx-unittest2pytest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Fdbx-unittest2pytest/lists"}