How to use the schemathesis._hypothesis.get_original_test function in schemathesis

To help you get started, we’ve selected a few schemathesis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kiwicom / schemathesis / test / test_compat.py View on Github external
def test_get_original_test_old_hypothesis(monkeypatch, version):
    monkeypatch.setattr(hypothesis, "__version_info__", version)

    def original_test():
        pass

    def wrapped():
        pass

    # When old hypothesis wraps the original test function
    wrapped._hypothesis_internal_settings_applied = True
    wrapped._hypothesis_internal_test_function_without_warning = original_test

    # Then original test should be returned from the function
    assert get_original_test(wrapped) is original_test
    # And it should be no-op for not-wrapped tests
    assert get_original_test(original_test) is original_test
github kiwicom / schemathesis / test / test_compat.py View on Github external
monkeypatch.setattr(hypothesis, "__version_info__", version)

    def original_test():
        pass

    def wrapped():
        pass

    # When old hypothesis wraps the original test function
    wrapped._hypothesis_internal_settings_applied = True
    wrapped._hypothesis_internal_test_function_without_warning = original_test

    # Then original test should be returned from the function
    assert get_original_test(wrapped) is original_test
    # And it should be no-op for not-wrapped tests
    assert get_original_test(original_test) is original_test
github kiwicom / schemathesis / test / test_compat.py View on Github external
def test_get_original_test_new_hypothesis(monkeypatch, version):
    monkeypatch.setattr(hypothesis, "__version_info__", version)

    def original_test():
        pass

    original_test._hypothesis_internal_settings_applied = True
    assert get_original_test(original_test) is original_test