CABLE-LSM / benchcab

Tool for evaluation of CABLE land surface model
https://benchcab.readthedocs.io/en/latest/
Apache License 2.0
2 stars 3 forks source link

Repeated class instantiation in `test_fluxsite.py` #203

Open SeanBryan51 opened 10 months ago

SeanBryan51 commented 10 months ago

While I was working on #183 I found that in test_fluxsite.py, the same classes are being instantiated in many places throughout the tests but with slightly different arguments. Therefore when I make a change to how a class is instantiated, I have to modify the tests in many places. I have listed examples of this below. This can be improved by making use of fixtures or fixture factories.

https://github.com/CABLE-LSM/benchcab/blob/bc08348bf8e79ae51af2ba7f5179468b39d8afb7/tests/test_fluxsite.py#L424

https://github.com/CABLE-LSM/benchcab/blob/bc08348bf8e79ae51af2ba7f5179468b39d8afb7/tests/test_fluxsite.py#L468

https://github.com/CABLE-LSM/benchcab/blob/bc08348bf8e79ae51af2ba7f5179468b39d8afb7/tests/test_fluxsite.py#L495

https://github.com/CABLE-LSM/benchcab/blob/bc08348bf8e79ae51af2ba7f5179468b39d8afb7/tests/test_fluxsite.py#L544-L545