@@ -49,6 +49,8 @@ async function sharedStackAnalysisTestFlow(testCase, usePipDepTreeUtility) {
4949}
5050
5151suite ( 'testing the python-pip data provider' , ( ) => {
52+ suiteSetup ( ( ) => clock = useFakeTimers ( new Date ( '2023-10-01T00:00:00.000Z' ) ) ) ;
53+ suiteTeardown ( ( ) => clock . restore ( ) ) ;
5254 [
5355 { name : 'requirements.txt' , expected : true } ,
5456 { name : 'some_other.file' , expected : false }
@@ -84,9 +86,11 @@ suite('testing the python-pip data provider', () => {
8486 } ) . timeout ( process . env . GITHUB_ACTIONS ? 15000 : 10000 )
8587 } ) ;
8688
87- } ) . beforeAll ( ( ) => clock = useFakeTimers ( new Date ( '2023-10-01T00:00:00.000Z' ) ) ) . afterAll ( ( ) => clock . restore ( ) ) ;
89+ } ) ;
8890
8991suite ( 'testing the python-pip data provider with virtual environment' , ( ) => {
92+ suiteSetup ( ( ) => clock = useFakeTimers ( new Date ( '2023-10-01T00:00:00.000Z' ) ) ) ;
93+ suiteTeardown ( ( ) => clock . restore ( ) ) ;
9094 [
9195 "pip_requirements_virtual_env_txt_no_ignore" ,
9296 "pip_requirements_virtual_env_with_ignore"
@@ -115,9 +119,11 @@ suite('testing the python-pip data provider with virtual environment', () => {
115119 } ) . timeout ( process . env . GITHUB_ACTIONS ? 60000 : 30000 )
116120 } )
117121
118- } ) . beforeAll ( ( ) => { clock = useFakeTimers ( new Date ( '2023-10-01T00:00:00.000Z' ) ) } ) . afterAll ( ( ) => clock . restore ( ) ) ;
122+ } ) ;
119123
120124suite ( 'testing python-pip PEP 508 marker handling' , ( ) => {
125+ suiteSetup ( ( ) => clock = useFakeTimers ( new Date ( '2023-10-01T00:00:00.000Z' ) ) ) ;
126+ suiteTeardown ( ( ) => clock . restore ( ) ) ;
121127 const markerTestCase = 'pip_requirements_txt_marker_skip'
122128
123129 /** Verify that packages with environment markers (PEP 508) that are not installed
@@ -153,9 +159,11 @@ suite('testing python-pip PEP 508 marker handling', () => {
153159 }
154160 } ) . timeout ( 10000 )
155161
156- } ) . beforeAll ( ( ) => clock = useFakeTimers ( new Date ( '2023-10-01T00:00:00.000Z' ) ) ) . afterAll ( ( ) => clock . restore ( ) ) ;
162+ } ) ;
157163
158164suite ( 'testing python-pip SHA-256 hash extraction via pip inspect' , ( ) => {
165+ suiteSetup ( ( ) => clock = useFakeTimers ( new Date ( '2023-10-01T00:00:00.000Z' ) ) ) ;
166+ suiteTeardown ( ( ) => clock . restore ( ) ) ;
159167 const hashTestCase = 'pip_requirements_txt_with_hashes'
160168
161169 const pipFreezeOutput = 'certifi==2023.7.22\nsix==1.16.0\n'
@@ -276,9 +284,11 @@ suite('testing python-pip SHA-256 hash extraction via pip inspect', () => {
276284 }
277285 } ) . timeout ( 10000 )
278286
279- } ) . beforeAll ( ( ) => clock = useFakeTimers ( new Date ( '2023-10-01T00:00:00.000Z' ) ) ) . afterAll ( ( ) => clock . restore ( ) ) ;
287+ } ) ;
280288
281289suite ( 'testing python-pip SHA-256 hashes with real pip inspect' , ( ) => {
290+ suiteSetup ( ( ) => clock = useFakeTimers ( new Date ( '2023-10-01T00:00:00.000Z' ) ) ) ;
291+ suiteTeardown ( ( ) => clock . restore ( ) ) ;
282292 const testCase = 'pip_requirements_txt_with_hashes'
283293
284294 /** Verifies SBOM components include SHA-256 hashes from real pip inspect. */
@@ -302,4 +312,4 @@ suite('testing python-pip SHA-256 hashes with real pip inspect', () => {
302312 }
303313 } ) . timeout ( process . env . GITHUB_ACTIONS ? 30000 : 10000 )
304314
305- } ) . beforeAll ( ( ) => clock = useFakeTimers ( new Date ( '2023-10-01T00:00:00.000Z' ) ) ) . afterAll ( ( ) => clock . restore ( ) ) ;
315+ } ) ;
0 commit comments