Skip to main content

pytest-tstcls

Test Class Base

How to use

Simple Tests

from tstcls import TestClassBase

class TestMyClass(TestClassBase):
    def setup_test(self):
        self.tester = MyClass()

    def test_my_method(self):
        ###
        self.tester.my_method()
        ###

Use Mocks

from tstcls import TestClassBase

class TestMyClass(TestClassBase):
    def setup_test(self):
        self.my_mocked_dependency = Mock()
        self.tester = MyClass(self.my_mocked_dependency)

    def test_my_method(self):
        self.my_mocked_dependency.return_value = 123

        ###
        self.tester.my_method()
        ###

Use fixtures as usual

from tstcls import TestClassBase

class TestMyClass(TestClassBase):
    @pytest.fixture
    def my_fixture(self):
        return 321

    def setup_test(self, my_fixture):
        self.tester = MyClass(my_fixture)

    def test_my_method(self, my_fixture):
        ###
        self.tester.my_method()
        ###

Metadata

Release files for pytest-tstcls 2020.1.1

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

Source distribution (sdist)

Source distribution for pytest-tstcls 2020.1.1
File Size Uploaded
pytest-tstcls-2020.1.1.tar.gz 2.0 kB Details

Release files / pytest-tstcls-2020.1.1.tar.gz

Download URL pytest-tstcls-2020.1.1.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fd91a46c864a798e10c21751ae6774d3dcc196f93937b6e8087e0c25615e23dc
BLAKE2b-256 checksum
How to use checksums
f48a732eb0796664412961ad3502abb2af9d335f8c8b36f9227946e0247b0f40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.16

Release history Release notifications | RSS feed

This release

2020.1.1 This release

1 release file

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