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
15 changes: 9 additions & 6 deletions tests/apps/app_django.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
import time
import opentracing
import opentracing.ext.tags as ext
try:
from django.urls import re_path
except ImportError:
from django.conf.urls import url as re_path

from django.conf.urls import url
from django.http import HttpResponse, Http404

filepath, extension = os.path.splitext(__file__)
Expand Down Expand Up @@ -123,9 +126,9 @@ def complex(request):


urlpatterns = [
url(r'^$', index, name='index'),
url(r'^cause_error$', cause_error, name='cause_error'),
url(r'^another$', another),
url(r'^not_found$', not_found, name='not_found'),
url(r'^complex$', complex, name='complex')
re_path(r'^$', index, name='index'),
re_path(r'^cause_error$', cause_error, name='cause_error'),
re_path(r'^another$', another),
re_path(r'^not_found$', not_found, name='not_found'),
re_path(r'^complex$', complex, name='complex')
]
6 changes: 6 additions & 0 deletions tests/clients/test_pymongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
import unittest
import logging
import pytest

from nose.tools import (assert_is_none, assert_is_not_none,
assert_false, assert_true, assert_list_equal)
Expand All @@ -18,6 +19,10 @@

logger = logging.getLogger(__name__)

pymongoversion = pytest.mark.skipif(
pymongo.version_tuple >= (4, 0), reason="map reduce is removed in pymongo 4.0"
)


class TestPyMongoTracer(unittest.TestCase):
def setUp(self):
Expand Down Expand Up @@ -169,6 +174,7 @@ def test_successful_aggregate_query(self):
payload = json.loads(db_span.data["mongo"]["json"])
assert_true({"$match": {"type": "string"}} in payload, db_span.data["mongo"]["json"])

@pymongoversion
def test_successful_map_reduce_query(self):
mapper = "function () { this.tags.forEach(function(z) { emit(z, 1); }); }"
reducer = "function (key, values) { return len(values); }"
Expand Down