Skip to content

Commit 43f1b41

Browse files
committed
TST: Move a call out of an assert in the standard error rounding test
CodeQL reported py/side-effect-in-assert for the call to np.delete inside the assert of test_std_errors_not_changed. np.delete returns a copy, so there was no side effect, but the call is now made before the assert.
1 parent 2f689c9 commit 43f1b41

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎linearmodels/tests/asset_pricing/test_std_errors_rounding.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def test_std_errors_not_changed():
8686
cov[2, 2] = np.nan
8787
se = _std_errors(cov)
8888
assert np.isnan(se[2])
89-
assert np.all(np.isfinite(np.delete(se, 2)))
89+
others = np.delete(se, 2)
90+
assert np.all(np.isfinite(others))
9091

9192

9293
@pytest.mark.parametrize("risk_free", [False, True])

0 commit comments

Comments
 (0)