ZAdamMac / Tapestry

Specialist Batch File Backup Tool
GNU General Public License v3.0
3 stars 1 forks source link

[Test Enhancement] Remove redundant `if __name__ == '__main__':` statement from parse_config #16

Closed ZAdamMac closed 5 years ago

ZAdamMac commented 5 years ago

Is your feature request related to a problem? Please describe. parse_config(), which itself is called inside a runtime function that is already wrapped in an if name main statement, contains such a statement which prevents most of its functions from executing in a situation where it is not executing as main - for example in the positive_tests.py package currently part of test-enhance.

Describe the solution you'd like Eliminate the if-name-main check from the function and shift everything behind it one tab to the left.

Describe alternatives you've considered It might be possible to use some kind of override in the test itself, but this is the more elegant solution.

Additional context This was tested in an uncommitted dev build of Tapestry and did not immediately appear to have any negative effects. It is required for positive_tests.test_parse_config() to complete successfully.

ZAdamMac commented 5 years ago

Code that fixes this issue is tested and validated. Because the branch it was fixed in is not yet ready for a move to master, and this issue is not a runtime issue, the 2.0.2 release will be delayed until the release of the full test-enhance branch.