Skip to content

Multiple tests written under single test name. #154

Closed
@HarsheetKakar

Description

@HarsheetKakar

Description of the problem

generally one module has one test which has all of the tests implemented in it.

Example of the problem

def test_Queue():

    q1 = Queue(implementation='array', items=[0])
    q1.append(1)
    q1.append(2)
    q1.append(3)

    q1 = Queue(implementation='linked_list')
    q1.append(1)
    assert raises(TypeError, lambda: Queue(implementation='linked_list', items={0, 1}))
    q1 = Queue(implementation='linked_list', items = [0, 1])
    q1.append(2)
    q1.append(3)

This can be changed to

test_Queue():
   <tests for Queue abstract class>

test_ArrayQueue():
   <tests for ArrayQueue class>

test_LinkedListQueue():
    <tests for LinkedListQueue class>

This will increase readability, and maintaining tests would be easier.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions