Skip to content

Unit tests depend on functions not being tested #394

Closed

Description

@cwhanse

test_irradiance.py uses

ephem_data = solarposition.get_solarposition(
    times, tus.latitude, tus.longitude, method='nrel_numpy')

irrad_data = tus.get_clearsky(times, model='ineichen', linke_turbidity=3)

dni_et = irradiance.extraradiation(times.dayofyear)

to compute known values for unit tests. This dependence on functions not under test could cause a unit test to fail when the unit's code is unchanged.

Activity

  1. added this to the 0.6.0 milestone on Nov 13, 2017
  2. wholmgren commented on Aug 14, 2018

    @wholmgren
    Member

    @cwhanse I reviewed the tests and I believe we can close this issue now that the PRs referenced above have been merged.

    test_atmosphere.py uses a similar pattern as shown in your description, but the returned values are not explicitly tested. There is already another issue, #158, for improving that test module.

  3. cwhanse commented on Aug 14, 2018

    @cwhanse
    MemberAuthor

    I agree, let's close this issue. If we find more tests with dependencies, we can reference this conversation, and fix those tests with their own issue and PR.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions