8b46f5470f895c1bf7dd9c89cb1972282d517718,tests/test_risk_models.py,,test_sample_cov_type_warning,#,45

Before Change


    cov_from_df = risk_models.sample_cov(df)

    returns_as_array = np.array(df)
    with warnings.catch_warnings(record=True) as w:
        cov_from_array = risk_models.sample_cov(returns_as_array)

        assert len(w) == 1
        assert issubclass(w[0].category, RuntimeWarning)
        assert str(w[0].message) == "data is not in a dataframe"

    np.testing.assert_array_almost_equal(
        cov_from_df.values, cov_from_array.values, decimal=6

After Change


    cov_from_df = risk_models.sample_cov(df)

    returns_as_array = np.array(df)
    with pytest.warns(RuntimeWarning) as w:
        cov_from_array = risk_models.sample_cov(returns_as_array)
        assert len(w) == 1
        assert str(w[0].message) == "data is not in a dataframe"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 6

Non-data size: 3

Instances


Project Name: robertmartin8/PyPortfolioOpt
Commit Name: 8b46f5470f895c1bf7dd9c89cb1972282d517718
Time: 2020-08-31
Author: martin.robertandrew@gmail.com
File Name: tests/test_risk_models.py
Class Name:
Method Name: test_sample_cov_type_warning


Project Name: robertmartin8/PyPortfolioOpt
Commit Name: 8b46f5470f895c1bf7dd9c89cb1972282d517718
Time: 2020-08-31
Author: martin.robertandrew@gmail.com
File Name: tests/test_efficient_frontier.py
Class Name:
Method Name: test_efficient_risk_market_neutral_warning


Project Name: robertmartin8/PyPortfolioOpt
Commit Name: 8b46f5470f895c1bf7dd9c89cb1972282d517718
Time: 2020-08-31
Author: martin.robertandrew@gmail.com
File Name: tests/test_expected_returns.py
Class Name:
Method Name: test_mean_historical_returns_type_warning


Project Name: robertmartin8/PyPortfolioOpt
Commit Name: 8b46f5470f895c1bf7dd9c89cb1972282d517718
Time: 2020-08-31
Author: martin.robertandrew@gmail.com
File Name: tests/test_risk_models.py
Class Name:
Method Name: test_sample_cov_npd


Project Name: robertmartin8/PyPortfolioOpt
Commit Name: 8b46f5470f895c1bf7dd9c89cb1972282d517718
Time: 2020-08-31
Author: martin.robertandrew@gmail.com
File Name: tests/test_risk_models.py
Class Name:
Method Name: test_cov_to_corr


Project Name: robertmartin8/PyPortfolioOpt
Commit Name: 8b46f5470f895c1bf7dd9c89cb1972282d517718
Time: 2020-08-31
Author: martin.robertandrew@gmail.com
File Name: tests/test_efficient_frontier.py
Class Name:
Method Name: test_efficient_return_market_neutral_warning