Skip to main content

For historical reasons, Python's built-in unittest module is not PEP-8 compliant. It uses camel case method names instead of snake case names. This is not going to change in Python 3. (1, 2, 3)

This could lead to stylistic inconsistencies, especially if one wants to write custom assertion methods and runs a pep-8 checker over their test code.

To address this stylistic itch, uneedtest offers a simple drop-in TestCase class which provides snake cased aliases to all the camel cased methods in unittest.TestCase.

Install

pip install uneedtest

Use

You can use uneedtest.TestCase in the same way you used to use unittest.TestCase before. It accepts calls to the corresponding snake case methods. The camel case methods are still working, allowing for gradually fading out their use in your test code base:

from uneedtest import TestCase

class TestMe(TestCase):
    def test_something(self):
        self.assert_equal(1, 1)
        self.assertEqual(1, 1)

Test

You can run the tests using poetry:

poetry run pytest

If you don't want to use poetry, you can run the tests with pytest or unittest directly:

pytest tests/

Metadata

Release files for uneedtest 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uneedtest 0.1.0
File Size Uploaded
uneedtest-0.1.0.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uneedtest 0.1.0
File Interpreter ABI Platform
uneedtest-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.7 kB

Release files / uneedtest-0.1.0.tar.gz

Download URL uneedtest-0.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1df30f4bd4a669c0bfcdf31bfb41d52fd465ab24a4e8a24aa36e08855d099036
BLAKE2b-256 checksum
How to use checksums
108046ed1680c0d14de439287ad5b027e4a5b4c12214dde16bb2478493c6a236
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.13 Linux/5.15.0-91-generic

Release files / uneedtest-0.1.0-py3-none-any.whl

Download URL uneedtest-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
901906a06a1dacf1873a7d598a909e3c8a53fdd3a054e5c7a7c0b085dddbc71b
BLAKE2b-256 checksum
How to use checksums
e8066f1b4a4cc08fcfe1379a518b19af27947651adb000e30569fe27279854da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.13 Linux/5.15.0-91-generic

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page