Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/instrumentation/cassandra_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 4 additions & 3 deletions tests/instrumentation/elasticsearch_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 4 additions & 1 deletion tests/instrumentation/pylibmc_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/instrumentation/pymongo_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 5 additions & 1 deletion tests/instrumentation/pymssql_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 5 additions & 1 deletion tests/instrumentation/pyodbc_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 5 additions & 1 deletion tests/instrumentation/python_memcached_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/instrumentation/redis_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
21 changes: 13 additions & 8 deletions tests/requirements/requirements-base.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down