Skip to content

Instantly share code, notes, and snippets.

@aychedee
Last active February 13, 2018 17:52
Show Gist options
  • Save aychedee/6021e7f41a383ec82f142d0934cbcdc9 to your computer and use it in GitHub Desktop.
Save aychedee/6021e7f41a383ec82f142d0934cbcdc9 to your computer and use it in GitHub Desktop.
Fast and slow tests using pytest
import pytest
import requests
def my_fast_func(x, y):
return x * y
@pytest.mark.slow
def test_talk_to_network():
assert requests.get('https://example.com').status_code == 200
def test_a_discrete_function():
assert my_fast_func(2, 4) == 8
# Then you can run only your fast tests with:
# pytest -v -m "not slow"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment