Use fixtures in Tests - test_twobody and test_angles #504
Conversation
If you want some early suggestions:
|
Sure. I will work on the other tests. I was just trying out. I will discuss with you today. :) |
52d8b8b
to
614ddd6
Compare
Codecov Report
@@ Coverage Diff @@
## master #504 +/- ##
=======================================
Coverage 86.04% 86.04%
=======================================
Files 49 49
Lines 2185 2185
Branches 165 165
=======================================
Hits 1880 1880
Misses 265 265
Partials 40 40 Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #504 +/- ##
=======================================
Coverage 86.07% 86.07%
=======================================
Files 49 49
Lines 2191 2191
Branches 166 166
=======================================
Hits 1886 1886
Misses 265 265
Partials 40 40 Continue to review full report at Codecov.
|
@Juanlu001 Please review whenever you get a chance. If you feel something is less than what it should be, please let me know, I will fix it. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @shreyasbapat for this PR and sorry for the huge delay 🙏 I left a couple of comments. Also, this will need a rebase.
src/poliastro/tests/test_twobody.py
Outdated
from poliastro.core.elements import coe2rv, coe2mee, rv2coe | ||
from poliastro.twobody.equinoctial import mee2coe | ||
|
||
|
||
def test_convert_between_coe_and_rv_is_transitive(): | ||
k = Earth.k.to(u.km**3 / u.s**2).value # u.km**3 / u.s**2 | ||
@pytest.fixture(scope="module") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know about scope="module"
, nice!
However, I believe that they are used for expensive fixtures, so I'd rather remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! will do so!
@@ -7,6 +7,24 @@ | |||
from poliastro.twobody import angles | |||
|
|||
|
|||
@pytest.fixture(scope="module") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this particular case, let's use ANGLES_DATA
just as a module variable, without using a fixture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay!
@Juanlu001 I have rebased as well as made the suggested changes :) |
Merged! Thanks for your patience :) |
Let's do this step by step. I will make several different pull requests which will eventually enable usage of fixtures in every place where it is better for us to use.