Skip to content

Commit d0f2a39

Browse files
authored
update pytest and its dependencies to newest possible version (#597)
we can't upgrade to 5.0 due to its lack of support for Python 2
1 parent 1e387ee commit d0f2a39

File tree

10 files changed

+57
-20
lines changed

10 files changed

+57
-20
lines changed

setup.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ markers =
1818
requests: mark a test as test of the requests library instrumentation
1919
boto3: mark a test as test of the boto3 library instrumentation
2020
elasticsearch: mark a test as elasticsearch test
21+
gevent
22+
celery
23+
opentracing
24+
zerorpc
25+
cassandra
26+
psycopg2
27+
mongodb
28+
memcached
29+
redis
30+
psutil
2131

2232
[isort]
2333
line_length=120

tests/instrumentation/cassandra_tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
from elasticapm.conf.constants import TRANSACTION
4141
from elasticapm.instrumentation.packages.dbapi2 import extract_signature
4242

43-
pytestmark = pytest.mark.cassandra
43+
pytestmark = [pytest.mark.cassandra]
44+
45+
if "CASSANDRA_HOST" not in os.environ:
46+
pytestmark.append(pytest.mark.skip("Skipping cassandra tests, no CASSANDRA_HOST environment variable set"))
4447

4548

4649
@pytest.fixture()

tests/instrumentation/elasticsearch_tests.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@
3939

4040
from elasticapm.conf.constants import TRANSACTION
4141

42+
pytestmark = [pytest.mark.elasticsearch]
43+
4244
if "ES_URL" not in os.environ:
43-
pytestmark = pytest.mark.skip("Skipping elasticsearch test, no ES_URL environment variable")
44-
else:
45-
pytestmark = pytest.mark.elasticsearch
45+
pytestmark.append(pytest.mark.skip("Skipping elasticsearch test, no ES_URL environment variable"))
46+
4647

4748
document_type = "_doc" if ES_VERSION[0] >= 6 else "doc"
4849

tests/instrumentation/pylibmc_tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737

3838
pylibmc = pytest.importorskip("pylibmc")
3939

40-
pytestmark = pytest.mark.pylibmc
40+
pytestmark = [pytest.mark.pylibmc]
41+
42+
if "MEMCACHED_HOST" not in os.environ:
43+
pytestmark.append(pytest.mark.skip("Skipping pylibmc tests, no MEMCACHED_HOST environment variable set"))
4144

4245

4346
@pytest.mark.integrationtest

tests/instrumentation/pymongo_tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
pymongo = pytest.importorskip("pymongo")
3939

4040

41-
pytestmark = pytest.mark.mongodb
41+
pytestmark = [pytest.mark.mongodb]
42+
43+
if "MONGODB_HOST" not in os.environ:
44+
pytestmark.append(pytest.mark.skip("Skipping mongodb tests, no MONGODB_HOST environment variable set"))
4245

4346

4447
@pytest.fixture()

tests/instrumentation/pymssql_tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636

3737
pymssql = pytest.importorskip("pymssql")
3838

39-
pytestmark = pytest.mark.pymssql
39+
pytestmark = [pytest.mark.pymssql]
40+
41+
42+
if "MSSQL_HOST" not in os.environ:
43+
pytestmark.append(pytest.mark.skip("Skipping MS-SQL tests, no MSSQL_HOST environment variable set"))
4044

4145

4246
@pytest.yield_fixture(scope="function")

tests/instrumentation/pyodbc_tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636

3737
pyodbc = pytest.importorskip("pyodbc")
3838

39-
pytestmark = pytest.mark.pyodbc
39+
pytestmark = [pytest.mark.pyodbc]
40+
41+
42+
if "POSTGRES_DB" not in os.environ:
43+
pytestmark.append(pytest.mark.skip("Skipping pyodbc tests, no POSTGRES_DB environment variable set"))
4044

4145

4246
@pytest.yield_fixture(scope="function")

tests/instrumentation/python_memcached_tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
memcache = pytest.importorskip("memcache") # isort:skip
3939

4040

41-
pytestmark = pytest.mark.memcached
41+
pytestmark = [pytest.mark.memcached]
42+
43+
44+
if "MEMCACHED_HOST" not in os.environ:
45+
pytestmark.append(pytest.mark.skip("Skipping memchached tests, no MEMCACHED_HOST environment variable set"))
4246

4347

4448
@pytest.mark.integrationtest

tests/instrumentation/redis_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
from elasticapm.conf.constants import TRANSACTION
4242
from elasticapm.traces import capture_span
4343

44+
pytestmark = [pytest.mark.redis]
45+
4446
if "REDIS_HOST" not in os.environ:
45-
pytestmark = pytest.mark.skip("Skipping redis tests, no REDIS_HOST environment variable set")
46-
else:
47-
pytestmark = pytest.mark.redis
47+
pytestmark.append(pytest.mark.skip("Skipping redis tests, no REDIS_HOST environment variable set"))
4848

4949

5050
@pytest.fixture()

tests/requirements/requirements-base.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
pytest==3.10.1
2-
py==1.7.0
1+
pytest==4.6.5
2+
py==1.8.0
33
more-itertools==4.1.0
4-
pluggy==0.8.0
5-
pytest-django==3.4.4
4+
pluggy==0.13.0
5+
pytest-django==3.5.1
66
atomicwrites==1.1.5
7-
coverage==4.5.2
8-
pytest-cov==2.6.0
7+
coverage==4.5.4
8+
pytest-cov==2.7.1
99
pytest-localserver==0.5.0
10-
pytest-mock==1.10.0
11-
pytest-benchmark==3.1.1
10+
pytest-mock==1.10.4
11+
pytest-benchmark==3.2.2
1212
jsonschema==2.6.0
13+
configparser==4.0.2
14+
contextlib2==0.6.0
15+
importlib-metadata==0.23
16+
packaging==19.2
17+
1318

1419
docutils==0.14
1520
pathlib==1.0.1

0 commit comments

Comments
 (0)