Skip to content

Commit

Permalink
Fixes a previously broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
StuntsPT committed Aug 2, 2021
1 parent 17157da commit e08e308
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_pyRona.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,19 +628,19 @@ def test_calculate_rona(tmpdir):
assert trpr == cpr


def test_results_summary():
def test_results_summary(capsys):
"""
Test the function results_summary of pyRona.py.
"""

top_ronas = [RONAS['15'], RONAS['11'], RONAS['14']]

test_res_summary = pr.results_summary(top_ronas, True)
pr.results_summary(top_ronas, True)
cap_out, _ = capsys.readouterr()

with open("../tests/data/jar/pyRona.results_summary.pickle", "rb") as fle:
control_results_summary = pickle.load(fle)
control_results_summary = 'Covar\t15\t11\t14\n#SNPs\t19\t8\t5\nAlgeria\t0.013529574810934185\t0.06991659085341603\t0.10519387557463623\nCatalonia\t0.09096401369276522\t0.33042827432762917\t0.035160534997867976\nCorsica\t0.016142582821629635\t0.07808188644235708\t0.0016112847462198174\nHaza_de_Lino\t0.0165731619528456\t0.0970012825691248\t0.04028211865549526\nKenitra\t0.0\t0.07495290838691165\t0.055776326583905605\nLandes\t0.0956269022547386\t0.08208789223743565\t0.02908944425764699\nMonchique\t0.003890478593702105\t0.06468037041565325\t0.0016112847462198163\nPuglia\t0.03325466253129237\t0.08780803564175099\t0.006387593101085693\nSardinia\t0.017420053404636298\t0.07364698931719132\t0.07224885710282047\nSicilia\t0.00325174330219878\t0.07474090478900575\t0.030038951340240753\nSintra\t0.006445419759715433\t0.05282815857307914\t0.020988608029702958\nTaza\t0.0006379029984244492\t0.09744456281929167\t0.07929822786753207\nToledo\t0.01225210422792753\t0.07840782467814407\t0.006071090740221045\nTuscany\t0.03871963725743228\t0.08136577184482335\t0.007020597822814872\nTunisia\t0.0006387352915033308\t0.08395342477073468\t0.10070529663873815\nVar\t0.023865473164351742\t0.08757675898948995\t0.006071090740221098\nMin R^2\t0.0003192070111058483\t0.0006640909658998809\t0.0005409312615854819\nMax R^2\t0.22867817097379825\t0.14430216359296372\t0.1676523858378404\nAverage R^2\t0.055106013883030346\t0.047016177041143144\t0.0414032469896604\n'

assert test_res_summary == control_results_summary
assert cap_out == control_results_summary


def test_ronas_filterer():
Expand Down

0 comments on commit e08e308

Please sign in to comment.