Example #1
0
def test_record_metrics_local(metric_name, metric_value):
    """
    You can record metrics during your run.
    The number of times doesn't matter, we record all of them.
    """
    assume(metric_name.strip() != '')
    assume(metric_name != None)
    try:
        with TrackingSession('test', 1, 'test', 'test',
                             LocalState()) as session:
            session.record_metric(metric_name, metric_value)
    except AssertionError:
        print('error')
Example #2
0
def test_record_settings_without_keys():
    with TrackingSession('test', 1, 'test', 'test', LocalState()) as session:
        session.record_settings()
Example #3
0
def test_session_scope_behavior():
    with TrackingSession('test', 1, 'test', 'test', LocalState()) as run:
        pass
Example #4
0
def test_record_output_with_non_existing_file():
    with pytest.raises(AssertionError):
        with TrackingSession('test', 1, 'test', 'test',
                             LocalState()) as session:
            session.record_output('test2.txt', 'test.txt')
Example #5
0
def test_record_settings():
    with TrackingSession('test', 1, 'test', 'test', LocalState()) as session:
        session.record_settings(test='value')
Example #6
0
def test_record_output_with_empty_source_file():
    with pytest.raises(AssertionError):
        with TrackingSession('test', 1, 'test', 'test',
                             LocalState()) as session:
            session.record_output(None, 'test.txt')
Example #7
0
def test_record_output_with_empty_filename(run_output):
    with pytest.raises(AssertionError):
        with TrackingSession('test', 1, 'test', 'test',
                             LocalState()) as session:
            session.record_output(run_output, None)
Example #8
0
def test_record_output(run_output):
    with TrackingSession('test', 1, 'test', 'test', LocalState()) as session:
        session.record_output(run_output, 'test.txt')
Example #9
0
def test_record_metric_with_invalid_name_type():
    with pytest.raises(AssertionError):
        with TrackingSession('test', 1, 'test', 'test',
                             LocalState()) as session:

            session.record_metric(1.0, 'invalid')
Example #10
0
def test_record_metric_without_value():
    with pytest.raises(AssertionError):
        with TrackingSession('test', 1, 'test', 'test',
                             LocalState()) as session:
            session.record_metric('test', None)