Hi all, I have a patch for the fileinput.FileInput class, adding a parameter to the __init__ method called write_mode in order to specify the write mode when using the class with the inplace parameter set to True. Before I submit the patch, I've added a test to the test module, and noticed that the module is pretty messy, with half of the tests being run in the module body, and the rest in a large function body. I propose to refactor the module, moving the tests into a unittest.TestCase subclass (essentially unchanged, bar changing verify calls to self.assert_ calls, raise TestFailed(...) to self.fail(...) etc). I think this will add clarity and modularity to the tests, and bring them into line with the unittest based test suite used by the test_file module amongst others (which I'm guessing are substantially more up to date than test_fileinput). Any thought? Cheers, -- Ant...
On 12/8/06, Anthony Roy
Hi all,
I have a patch for the fileinput.FileInput class, adding a parameter to the __init__ method called write_mode in order to specify the write mode when using the class with the inplace parameter set to True.
Before I submit the patch, I've added a test to the test module, and noticed that the module is pretty messy, with half of the tests being run in the module body, and the rest in a large function body.
I propose to refactor the module, moving the tests into a unittest.TestCase subclass (essentially unchanged, bar changing verify calls to self.assert_ calls, raise TestFailed(...) to self.fail(...) etc). I think this will add clarity and modularity to the tests, and bring them into line with the unittest based test suite used by the test_file module amongst others (which I'm guessing are substantially more up to date than test_fileinput).
Any thought?
Please do! It's always nice to have once less test not using unittest or doctest. -Brett
Anthony Roy schrieb:
Any thought?
In addition to what Brett said: please make functionality changes and refactoring separate patches (specify the order of application if one depends on the other). When reading commit message, or performing "svn blame", it's important to know whether a change is just a structural one, or a substantial one. Regards, Martin
participants (3)
-
"Martin v. Löwis"
-
Anthony Roy
-
Brett Cannon