Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1967 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

`test_config.test_windows_filenames` fails in 1.1 branch

Reported by: Chris Arndt Owned by: anonymous
Priority: high Milestone: 1.1b1
Component: Tests Version: 1.1 HEAD
Severity: normal Keywords: tests, configuration
Cc:

Description

test_config.test_windows_filenames fails in 1.1 branch on this line. The same test code passes in the 1.0 branch.

The way this test module is written is totally weird and I don't understand why it ever worked:

  • The tests have no docstrings so you have to guess what they test for
  • The tests influence each other by changing the global configuration and not unsetting the changes
  • A test changes the pkg_resources.resource_filename function midway through the execution of the module but this is only undone by the teardown_module function at the end of the tests.
  • The behaviour of windows_filename function changes with the number of times it has been called and thus make the test results dependent on the order of the statements in the module and the order of the execution of the tests.

I think this test module needs to be seriously refactored. I attach a patch with a first go at this. Unfortunately this doesn't fix the failing test, but since I have no idea what it is supposed to test, I don't know how to do this.

Attachments

test_config-cleanup.diff Download (2.2 KB) - added by Chris Arndt 9 years ago.

Change History

Changed 9 years ago by Chris Arndt

comment:1 Changed 9 years ago by Chris Arndt

  • Milestone changed from 1.1 to 1.1 beta 1

comment:2 Changed 9 years ago by faide

This was indeed related to #1958 and was fixed in r5333 at the same time as #1958. I also committed some comments in the tests to make the more clear and some cleanup after the monkey patch.

BUT your refactoring of this test would be more than welcome because this test is _really_ messy at the moment.

comment:3 Changed 9 years ago by Chris Arndt

  • Status changed from new to closed
  • Resolution set to fixed

Really fixed (also for non-windows systems) in r5336.

Note: See TracTickets for help on using tickets.