File tree Expand file tree Collapse file tree 3 files changed +23
-11
lines changed
Expand file tree Collapse file tree 3 files changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -1447,15 +1447,15 @@ async def updated_input():
14471447 # for determining any other changes than file modification dates, as it will
14481448 # change after evaluating the input function of the job in the second pass.
14491449
1450- # The list comprehension is needed below in order to
1451- # collect all the async generator items before
1452- # applying any().
1453- reason .code_changed = any (
1454- [
1455- f
1456- async for f in job .outputs_older_than_script_or_notebook ()
1457- ]
1458- )
1450+ if RerunTrigger . CODE in self . workflow . rerun_triggers :
1451+ # job metadata can be missed, but the separate scripts don't.
1452+ # but it should not work if unwanted
1453+ reason .code_changed = any (
1454+ [
1455+ f
1456+ async for f in job .outputs_older_than_script_or_notebook ()
1457+ ]
1458+ )
14591459 if not self .workflow .persistence .has_metadata (job ):
14601460 reason .no_metadata = True
14611461 elif self .workflow .persistence .has_outdated_metadata (job ):
Original file line number Diff line number Diff line change 1313from os .path import join
1414import tempfile
1515import hashlib
16- import urllib
16+ import urllib . request
1717import pytest
1818import glob
1919import subprocess
Original file line number Diff line number Diff line change @@ -479,7 +479,19 @@ def test_empty_include():
479479
480480
481481def test_script_python ():
482- run (dpath ("test_script_py" ))
482+ tmpdir = run (dpath ("test_script_py" ), cleanup = False )
483+ outfile_path = os .path .join (tmpdir , "test.out" )
484+ outfile_timestamp_orig = os .path .getmtime (outfile_path )
485+ # update timestamp but not contents of input file
486+ script_file = os .path .join (tmpdir , "scripts/test.py" )
487+ os .utime (script_file )
488+ run (
489+ dpath ("test_script_py" ),
490+ rerun_triggers = frozenset ([RerunTrigger .MTIME ]),
491+ cleanup = False ,
492+ )
493+ outfile_timestamp_new = os .path .getmtime (outfile_path )
494+ assert outfile_timestamp_orig == outfile_timestamp_new
483495
484496
485497@skip_on_windows # Test relies on perl
You can’t perform that action at this time.
0 commit comments