Skip to content

add tests to increase coverage#731

Open
JohananOppongAmoateng wants to merge 2 commits intobeeware:mainfrom
JohananOppongAmoateng:covergae
Open

add tests to increase coverage#731
JohananOppongAmoateng wants to merge 2 commits intobeeware:mainfrom
JohananOppongAmoateng:covergae

Conversation

@JohananOppongAmoateng
Copy link
Copy Markdown

Add more tests to increase coverage. #729

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Comment thread tests/test_types.py


def test_maker_functions():
"""Test maker functions (lines 888, 893, 903, 908, 913, 938)"""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two notes here:

  1. You don't refer to specific lines of code in coverage, because a one line unrelated change in the same file will make all the line references invalid. Refer to a specific feature that is being tested.
  2. In this test, you're testing 7 different maker methods. These should be 7 independent tests (or, at least, one test that has been parameterised with 7 items).
  3. We're not just looking to verify line coverage - we want to verify that the thing being tested works as advertised. An isinstance check is one thing to verify - but verifying that the attributes of the created object have been set correctly is the other key detail.

Comment thread tests/test_types.py


def test_compound_value_errors():
"""Test compound_value_for_sequence errors (lines 598, 620, 660)"""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test should verify exactly one behaviour. There are three behaviours being tested here; that means 3 tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants