Skip to content

Commit

Permalink
Try fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
twiecki committed Sep 18, 2019
1 parent a3a1ae4 commit 53a1c43
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions pyfolio/tests/test_risk.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ def test_compute_sector_exposures(self, positions, sectors,
expected_shorted.columns = expected_shorted.columns.astype(int)
expected_grossed.columns = expected_grossed.columns.astype(int)

assert_frame_equal(pd.concat(sector_exposures[0], axis=1),
expected_longed)
assert_frame_equal(pd.concat(sector_exposures[1], axis=1),
expected_shorted)
assert_frame_equal(pd.concat(sector_exposures[0], axis=1).fillna(0.),
expected_longed.fillna(0.))
assert_frame_equal(pd.concat(sector_exposures[1], axis=1).fillna(0.),
expected_shorted.fillna(0.))
assert_frame_equal(pd.concat(sector_exposures[2], axis=1),
expected_grossed)
expected_grossed.fillna(0.))

@parameterized.expand([
(test_pos, test_caps, expected_caps_longed, expected_caps_shorted,
Expand All @@ -134,14 +134,14 @@ def test_compute_cap_exposures(self, positions, caps,
expected_grossed.columns = expected_grossed.columns.astype(int)
expected_netted.columns = expected_netted.columns.astype(int)

assert_frame_equal(pd.concat(cap_exposures[0], axis=1),
expected_longed)
assert_frame_equal(pd.concat(cap_exposures[1], axis=1),
expected_shorted)
assert_frame_equal(pd.concat(cap_exposures[2], axis=1),
expected_grossed)
assert_frame_equal(pd.concat(cap_exposures[3], axis=1),
expected_netted)
assert_frame_equal(pd.concat(cap_exposures[0], axis=1).fillna(0.),
expected_longed.fillna(0.))
assert_frame_equal(pd.concat(cap_exposures[1], axis=1).fillna(0.),
expected_shorted.fillna(0.))
assert_frame_equal(pd.concat(cap_exposures[2], axis=1).fillna(0.),
expected_grossed.fillna(0.))
assert_frame_equal(pd.concat(cap_exposures[3], axis=1).fillna(0.),
expected_netted.fillna(0.))

@parameterized.expand([
(test_shares_held, test_volumes, 0.1, expected_volumes)
Expand Down

0 comments on commit 53a1c43

Please sign in to comment.