Skip to content

Unit tests depend on functions not being tested #394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cwhanse opened this issue Nov 2, 2017 · 2 comments
Closed

Unit tests depend on functions not being tested #394

cwhanse opened this issue Nov 2, 2017 · 2 comments
Labels
Milestone

Comments

@cwhanse
Copy link
Member

cwhanse commented Nov 2, 2017

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.

@wholmgren
Copy link
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.

@cwhanse
Copy link
Member Author

cwhanse commented Aug 14, 2018

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.

@cwhanse cwhanse closed this as completed Aug 14, 2018
@steve-ransome steve-ransome mentioned this issue Sep 5, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants