Ejemplo n.º 1
0
def test_record_metrics_remote(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)

    with TrackingSession('test', 1, 'test', 'test') as session:
        session.change(RemoteState)

        session.record_metric(metric_name, metric_value)
Ejemplo n.º 2
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')
Ejemplo n.º 3
0
def test_record_settings_without_keys():
    with TrackingSession('test', 1, 'test', 'test', LocalState()) as session:
        session.record_settings()
Ejemplo n.º 4
0
def test_session_scope_behavior():
    with TrackingSession('test', 1, 'test', 'test', LocalState()) as run:
        pass
Ejemplo n.º 5
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')
Ejemplo n.º 6
0
def test_record_settings():
    with TrackingSession('test', 1, 'test', 'test', LocalState()) as session:
        session.record_settings(test='value')
Ejemplo n.º 7
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')
Ejemplo n.º 8
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)
Ejemplo n.º 9
0
def test_record_output(run_output):
    with TrackingSession('test', 1, 'test', 'test', LocalState()) as session:
        session.record_output(run_output, 'test.txt')
Ejemplo n.º 10
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')
Ejemplo n.º 11
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)