Kaydet (Commit) 261ccdce authored tarafından Éric Araujo's avatar Éric Araujo

Minor tweak to packaging tests.

When an option is changed on a command object, calling ensure_finalized
for a second time will not run finalize_options again, because
ensure_finalized is a no-op the second time.  By resetting the finalized
attribute, we can be sure that whatever computation takes place in
finalize_options will happen again.

(In test_command_clean, I removed two lines that were a no-op.)
üst a963e0d9
...@@ -36,8 +36,6 @@ class cleanTestCase(support.TempdirManager, support.LoggingCatcher, ...@@ -36,8 +36,6 @@ class cleanTestCase(support.TempdirManager, support.LoggingCatcher,
'%r was not removed' % path) '%r was not removed' % path)
# let's run the command again (should spit warnings but succeed) # let's run the command again (should spit warnings but succeed)
cmd.all = True
cmd.ensure_finalized()
cmd.run() cmd.run()
......
...@@ -62,6 +62,7 @@ class InstallDataTestCase(support.TempdirManager, ...@@ -62,6 +62,7 @@ class InstallDataTestCase(support.TempdirManager,
# let's try with warn_dir one # let's try with warn_dir one
cmd.warn_dir = True cmd.warn_dir = True
cmd.finalized = False
cmd.ensure_finalized() cmd.ensure_finalized()
cmd.run() cmd.run()
...@@ -80,6 +81,7 @@ class InstallDataTestCase(support.TempdirManager, ...@@ -80,6 +81,7 @@ class InstallDataTestCase(support.TempdirManager,
cmd.data_files = {one: '{inst}/one', two: '{inst2}/two', cmd.data_files = {one: '{inst}/one', two: '{inst2}/two',
three: '{inst3}/three'} three: '{inst3}/three'}
cmd.finalized = False
cmd.ensure_finalized() cmd.ensure_finalized()
cmd.run() cmd.run()
......
...@@ -143,6 +143,7 @@ class RegisterTestCase(support.TempdirManager, ...@@ -143,6 +143,7 @@ class RegisterTestCase(support.TempdirManager,
register_module.input = _no_way register_module.input = _no_way
cmd.show_response = True cmd.show_response = True
cmd.finalized = False
cmd.ensure_finalized() cmd.ensure_finalized()
cmd.run() cmd.run()
......
...@@ -140,7 +140,7 @@ class SDistTestCase(support.TempdirManager, ...@@ -140,7 +140,7 @@ class SDistTestCase(support.TempdirManager,
# now trying a tar then a gztar # now trying a tar then a gztar
cmd.formats = ['tar', 'gztar'] cmd.formats = ['tar', 'gztar']
cmd.finalized = False
cmd.ensure_finalized() cmd.ensure_finalized()
cmd.run() cmd.run()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment