stephenslab / susieR

R package for "sum of single effects" regression.
https://stephenslab.github.io/susieR
Other
176 stars 45 forks source link

Use `with` in place of `attach` for unit tests #73

Closed gaow closed 5 years ago

gaow commented 5 years ago

Currently we have in unit tests

testthat(
   simulate(...)
   ...
)

where for simulate instead of returning an object it calls attach in the end.

I think if we still want to use such "environment" notion we can change it to:

testthat(
   with(simulate(...),
 {
   ...
 })
)

and have simulate return something.

See for example this file for the simulation implementation and this file for the function call.

gaow commented 5 years ago

Resolved in trendfiltering branch, thanks @KaiqianZhang for the work!