Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Tests #50

Closed
8 tasks done
sco1 opened this issue Nov 21, 2019 · 1 comment
Closed
8 tasks done

Refactor Tests #50

sco1 opened this issue Nov 21, 2019 · 1 comment
Assignees

Comments

@sco1
Copy link
Owner

sco1 commented Nov 21, 2019

Some aspects of the test suite are written in a way that makes them fairly fragile and difficult to both maintain and add additional cases to.

As an example, test_column_line_numbers relies on explicitly coded locations matching the formatting of column_line_numbers.py, making updates a manually intensive, error-prone process across multiple files.

This issue proposes investigating potential alternatives for specifying test cases & their expected returns to provide a more robust & maintainable test suite. One thought is to split monolithic source code blocks into more discrete components, allowing them to be more easily colocated with the test parameters.

Using the above example, our source file would be split into something along the lines of the following:

a_test_case = """def bar(x):
    pass
"""
# Expected yielded code definition

and

another_test_case = """@property
@some_decorator
@some_other_decorator
def foo(
    x,
    y
):
    pass
"""
# Expected yielded code definition

While this would potentially make test case specification more verbose overall, I believe it's significantly outweighed by the ease of making changes to the test suite; rather than having to adjusted every column & line number in the file, only the specific case needs to be adjusted.

With this in mind, here first-glance rundown of what's proposed to be looked at:

To be investigated:

Seems ok(ish):

@sco1 sco1 self-assigned this Nov 21, 2019
@sco1 sco1 added the testing label Nov 21, 2019
@sco1 sco1 mentioned this issue Nov 22, 2019
@sco1
Copy link
Owner Author

sco1 commented Nov 22, 2019

This has been actioned & added to #40

@sco1 sco1 closed this as completed Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant