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

Closed
opened 2019-10-04 23:10:19 +00:00 by ZAdamMac · 1 comment
ZAdamMac commented 2019-10-04 23:10:19 +00:00 (Migrated from github.com)

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.

**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 2019-10-09 01:57:52 +00:00 (Migrated from github.com)

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.

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.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zadammac/Tapestry#16
No description provided.