test(python): share pyc code fixture construction (#15652)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-01 22:38:11 +00:00
1 parent 2f304e5c29
commit caf4550b42
5 files changed
+184 -269

No files matched your search

+7
View File
@@ -146,6 +146,13 @@ export const marshalCode = (
return concat(...parts);
};
/** A timestamp-header pyc with independently selected magic and code layout. */
export const pythonPycWithCode = (
magic: number,
layout: PythonPycCodeLayout,
fields: FixtureCodeFields = {},
): Buffer => concat(pythonPycHeader(magic), marshalCode(layout, fields));
/** Complete pyc with a module code object and optional nested function. */
export const pythonPycFixture = (
layout: PythonPycCodeLayout = "py311",