Skip to main content

nrevah-tstcls: Test Class Base

Project description

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()
        ###

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

nrevah_tstcls-1.0.1.tar.gz (1.6 kB view details)

Uploaded Source

Built Distribution

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

nrevah_tstcls-1.0.1-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

Details for the file nrevah_tstcls-1.0.1.tar.gz.

File metadata

  • Download URL: nrevah_tstcls-1.0.1.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nrevah_tstcls-1.0.1.tar.gz
Algorithm Hash digest
SHA256 efc22583ce9d12f90735432ec18bca68aec7ee7a2dc4c74a863b6e5025559594
MD5 adf566448d428adfa0e781e812df58ff
BLAKE2b-256 5ef9a109291ce144d27fbc29afe94d969c11ece8989e7803ea444f9b60638da3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nrevah_tstcls-1.0.1.tar.gz:

Publisher: release.yml on netanelrevah/tstcls

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nrevah_tstcls-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: nrevah_tstcls-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nrevah_tstcls-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f8d69ee0f48afcf920eea42b0cefcaa63fc85a6c6cd9487933cdbbe1ddc35ac
MD5 6887d7430338abe2f35e6d559d4c6582
BLAKE2b-256 aa297bd0fe4a9d40d527bd2a337b441921a6e64e8b2ca3f593f5dab416ebfe02

See more details on using hashes here.

Provenance

The following attestation bundles were made for nrevah_tstcls-1.0.1-py3-none-any.whl:

Publisher: release.yml on netanelrevah/tstcls

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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