diff --git a/setup.cfg b/setup.cfg index 3093655fb..3ea1acedd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,16 @@ markers = requests: mark a test as test of the requests library instrumentation boto3: mark a test as test of the boto3 library instrumentation elasticsearch: mark a test as elasticsearch test + gevent + celery + opentracing + zerorpc + cassandra + psycopg2 + mongodb + memcached + redis + psutil [isort] line_length=120 diff --git a/tests/instrumentation/cassandra_tests.py b/tests/instrumentation/cassandra_tests.py index cc0215064..c4cbd85c0 100644 --- a/tests/instrumentation/cassandra_tests.py +++ b/tests/instrumentation/cassandra_tests.py @@ -40,7 +40,10 @@ from elasticapm.conf.constants import TRANSACTION from elasticapm.instrumentation.packages.dbapi2 import extract_signature -pytestmark = pytest.mark.cassandra +pytestmark = [pytest.mark.cassandra] + +if "CASSANDRA_HOST" not in os.environ: + pytestmark.append(pytest.mark.skip("Skipping cassandra tests, no CASSANDRA_HOST environment variable set")) @pytest.fixture() diff --git a/tests/instrumentation/elasticsearch_tests.py b/tests/instrumentation/elasticsearch_tests.py index dfb17dded..74a8588d4 100644 --- a/tests/instrumentation/elasticsearch_tests.py +++ b/tests/instrumentation/elasticsearch_tests.py @@ -39,10 +39,11 @@ from elasticapm.conf.constants import TRANSACTION +pytestmark = [pytest.mark.elasticsearch] + if "ES_URL" not in os.environ: - pytestmark = pytest.mark.skip("Skipping elasticsearch test, no ES_URL environment variable") -else: - pytestmark = pytest.mark.elasticsearch + pytestmark.append(pytest.mark.skip("Skipping elasticsearch test, no ES_URL environment variable")) + document_type = "_doc" if ES_VERSION[0] >= 6 else "doc" diff --git a/tests/instrumentation/pylibmc_tests.py b/tests/instrumentation/pylibmc_tests.py index 837b1b42a..a6e865eb7 100644 --- a/tests/instrumentation/pylibmc_tests.py +++ b/tests/instrumentation/pylibmc_tests.py @@ -37,7 +37,10 @@ pylibmc = pytest.importorskip("pylibmc") -pytestmark = pytest.mark.pylibmc +pytestmark = [pytest.mark.pylibmc] + +if "MEMCACHED_HOST" not in os.environ: + pytestmark.append(pytest.mark.skip("Skipping pylibmc tests, no MEMCACHED_HOST environment variable set")) @pytest.mark.integrationtest diff --git a/tests/instrumentation/pymongo_tests.py b/tests/instrumentation/pymongo_tests.py index c59391c01..15f528980 100644 --- a/tests/instrumentation/pymongo_tests.py +++ b/tests/instrumentation/pymongo_tests.py @@ -38,7 +38,10 @@ pymongo = pytest.importorskip("pymongo") -pytestmark = pytest.mark.mongodb +pytestmark = [pytest.mark.mongodb] + +if "MONGODB_HOST" not in os.environ: + pytestmark.append(pytest.mark.skip("Skipping mongodb tests, no MONGODB_HOST environment variable set")) @pytest.fixture() diff --git a/tests/instrumentation/pymssql_tests.py b/tests/instrumentation/pymssql_tests.py index 97d7eefb7..58d893897 100644 --- a/tests/instrumentation/pymssql_tests.py +++ b/tests/instrumentation/pymssql_tests.py @@ -36,7 +36,11 @@ pymssql = pytest.importorskip("pymssql") -pytestmark = pytest.mark.pymssql +pytestmark = [pytest.mark.pymssql] + + +if "MSSQL_HOST" not in os.environ: + pytestmark.append(pytest.mark.skip("Skipping MS-SQL tests, no MSSQL_HOST environment variable set")) @pytest.yield_fixture(scope="function") diff --git a/tests/instrumentation/pyodbc_tests.py b/tests/instrumentation/pyodbc_tests.py index 9577d5610..1f8769ab6 100644 --- a/tests/instrumentation/pyodbc_tests.py +++ b/tests/instrumentation/pyodbc_tests.py @@ -36,7 +36,11 @@ pyodbc = pytest.importorskip("pyodbc") -pytestmark = pytest.mark.pyodbc +pytestmark = [pytest.mark.pyodbc] + + +if "POSTGRES_DB" not in os.environ: + pytestmark.append(pytest.mark.skip("Skipping pyodbc tests, no POSTGRES_DB environment variable set")) @pytest.yield_fixture(scope="function") diff --git a/tests/instrumentation/python_memcached_tests.py b/tests/instrumentation/python_memcached_tests.py index 179f58ab2..db16dbc14 100644 --- a/tests/instrumentation/python_memcached_tests.py +++ b/tests/instrumentation/python_memcached_tests.py @@ -38,7 +38,11 @@ memcache = pytest.importorskip("memcache") # isort:skip -pytestmark = pytest.mark.memcached +pytestmark = [pytest.mark.memcached] + + +if "MEMCACHED_HOST" not in os.environ: + pytestmark.append(pytest.mark.skip("Skipping memchached tests, no MEMCACHED_HOST environment variable set")) @pytest.mark.integrationtest diff --git a/tests/instrumentation/redis_tests.py b/tests/instrumentation/redis_tests.py index d3a7c2253..dbe6457ff 100644 --- a/tests/instrumentation/redis_tests.py +++ b/tests/instrumentation/redis_tests.py @@ -41,10 +41,10 @@ from elasticapm.conf.constants import TRANSACTION from elasticapm.traces import capture_span +pytestmark = [pytest.mark.redis] + if "REDIS_HOST" not in os.environ: - pytestmark = pytest.mark.skip("Skipping redis tests, no REDIS_HOST environment variable set") -else: - pytestmark = pytest.mark.redis + pytestmark.append(pytest.mark.skip("Skipping redis tests, no REDIS_HOST environment variable set")) @pytest.fixture() diff --git a/tests/requirements/requirements-base.txt b/tests/requirements/requirements-base.txt index 2fd90c08c..1855af832 100644 --- a/tests/requirements/requirements-base.txt +++ b/tests/requirements/requirements-base.txt @@ -1,15 +1,20 @@ -pytest==3.10.1 -py==1.7.0 +pytest==4.6.5 +py==1.8.0 more-itertools==4.1.0 -pluggy==0.8.0 -pytest-django==3.4.4 +pluggy==0.13.0 +pytest-django==3.5.1 atomicwrites==1.1.5 -coverage==4.5.2 -pytest-cov==2.6.0 +coverage==4.5.4 +pytest-cov==2.7.1 pytest-localserver==0.5.0 -pytest-mock==1.10.0 -pytest-benchmark==3.1.1 +pytest-mock==1.10.4 +pytest-benchmark==3.2.2 jsonschema==2.6.0 +configparser==4.0.2 +contextlib2==0.6.0 +importlib-metadata==0.23 +packaging==19.2 + docutils==0.14 pathlib==1.0.1