Yelp / Testify

A more pythonic testing framework.
Other
304 stars 67 forks source link

Fixing Testify to report test case results when it finishes #322

Closed chunkyg closed 8 years ago

chunkyg commented 8 years ago

Fixing a bug, testify stopped reporting/writing test case results(--test-case-results) in its latest version(v0.8.0). This change will fix the issue.

asottile commented 8 years ago

Please write a regression test so this doesn't break in the future -- I'd suggest an end-to-end test in test/plugins/test_case_time_log_test.py

You're also failing flake8 which means you didn't run the testsuite :(

asottile commented 8 years ago

An integration would actually be easier than what you wrote:

with tempdir() as tmpdir:
    tempfile = os.path.join(tempdir, 'tmp.json')
    subprocess.check_call((
        sys.executable, '-m', 'testify.test_program', '--test-case-results', tempfile, 'test/test_suite_subdir/define_testcase.py'
    ))
    with open(tempfile, 'r') as f:
        contents = json.load(f)
        T.assert_in('start_time', contents)
        T.assert_in('end_time', contents)

or something like that

ydgholz commented 8 years ago

Let's release this and add the integration test to the followup issue (where we factor out the method param to TestResult)