-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test failures in Python 3.12.0 on Mac M1 #889
Comments
Follow up. I've been able to run |
Following up on this issue... it appears the issue is with reading files that were saved via CloudPickle in versions of Python < 3.12. I have no problems running the model generally, but when running tests, those test modules that import objects saved via CloudPickle (e.g.,
The lack of any traceback makes it not clear, but I if I comment out the lines reading in these CloudPickled files, I do get some tests collected and run (of course there is an error noting that I don't the the parameters object available since I didn't import it, but we can at least see that tests try to run):
|
We already have separate parameter files for Python 3.11 and Python 3.9/10: if sys.version_info[1] < 11:
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl")
)
else:
base_params = utils.safe_read_pickle(
os.path.join(
CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl"
)
) Other times, we don't run certain parameterizations under a different Python version: if sys.version_info[1] < 11:
test_list = [
(base_taxfunctions, 43, "DEP", "etr", True, None, None),
(base_taxfunctions, 43, "DEP", "etr", False, None, "Test title"),
(GS_nonage_spec_taxfunctions, None, "GS", "etr", True, None, None),
(base_taxfunctions, 43, "DEP", "etr", True, [micro_data], None),
(base_taxfunctions, 43, "DEP", "mtry", True, [micro_data], None),
(base_taxfunctions, 43, "DEP", "mtrx", True, [micro_data], None),
(mono_nonage_spec_taxfunctions, None, "mono", "etr", True, None, None),
]
id_list = [
"over_labinc=True",
"over_labinc=False",
"Non age-specific",
"with data",
"MTR capital income",
"MTR labor income",
"Mono functions",
]
else:
test_list = [
(base_taxfunctions, 43, "DEP", "etr", True, None, None),
(base_taxfunctions, 43, "DEP", "etr", False, None, "Test title"),
(GS_nonage_spec_taxfunctions, None, "GS", "etr", True, None, None),
(base_taxfunctions, 43, "DEP", "etr", True, [micro_data], None),
(base_taxfunctions, 43, "DEP", "mtry", True, [micro_data], None),
(base_taxfunctions, 43, "DEP", "mtrx", True, [micro_data], None),
]
id_list = [
"over_labinc=True",
"over_labinc=False",
"Non age-specific",
"with data",
"MTR capital income",
"MTR labor income",
]
@pytest.mark.parametrize(
"tax_funcs,age,tax_func_type,rate_type,over_labinc,data,title",
test_list,
ids=id_list,
)
def test_plot_2D_taxfunc(
tax_funcs, age, tax_func_type, rate_type, over_labinc, data, title
):
"""
Test of plot_2D_taxfunc
"""
if sys.version_info[1] < 11:
fig = parameter_plots.plot_2D_taxfunc(
2030,
2021,
[tax_funcs],
age=age,
tax_func_type=[tax_func_type],
rate_type=rate_type,
over_labinc=over_labinc,
data_list=data,
title=title,
)
assert fig
else:
assert True @rickecon What do you want to do for Python 3.12? Create a third |
Resolved with PR #969 |
I recently rebuilt the
ogcore-dev
environment and tried to run the OG-Core testing suite. It resulted in an error when collecting tests:I've not seen this before an a quick search didn't reveal an obvious solution.
The text was updated successfully, but these errors were encountered: