Skip to content

Reduce test_exercise duplication + fix reporter statefulness #20

@filipsch

Description

@filipsch
  • There is a test_exercise function in sqlwhat and shellwhat, but not in protowhat. Seems like test_exercise should be moved there, with a smart way of including the language-specific SCT context and state

  • The reporter depends on a singleton-like failed_test variable, that it uses to build up a payload. It is not required. Thoughts by @machow about this:

I regret never finishing cleaning up Reporter (and taking out failed_test). It would super clean to have reporter just hold options for reporting outcomes, and then rather than carrying around the backend output with it, test_exercise could pass that at the end. See [here](see https://github.com/datacamp/protowhat/blob/fs/test-not/protowhat/Reporter.py#L57-L58). Something like

def fake_test_exercise(output):
    reporter = Reporter()
    try: test_something('bleh')
    except TestFail as e:
        return reporter.build_payload(e)
    return reporter.build_payload(output)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions