Skip to content

Commit 0d2a5f0

Browse files
build: Remove Pytest pin
Remove Pytest pin. This requires ensuring that any test modules which contain both forked and non-forked tests do not have a forked test as the last test in the module. See [here](pytest-dev/pytest-forked#67 (comment)). Closes #3035
1 parent 772dd77 commit 0d2a5f0

File tree

10 files changed

+58
-1
lines changed

10 files changed

+58
-1
lines changed

requirements-devenv.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-r requirements-linting.txt
22
-r requirements-testing.txt
33
mockupdb # required by `pymongo` tests that are enabled by `pymongo` from linter requirements
4-
pytest<7.0.0 # https://github.com/pytest-dev/pytest/issues/9621; see tox.ini
4+
pytest
55
pytest-asyncio

sentry_sdk/integrations/logging.py

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ def _emit(self, record):
246246
}
247247

248248
else:
249+
breakpoint()
249250
event["logentry"] = {
250251
"message": to_string(record.msg),
251252
"params": record.args,

tests/integrations/celery/integration_tests/test_celery_beat_cron_monitoring.py

+7
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,10 @@ def test_task():
151151
assert check_in["type"] == "check_in"
152152
assert check_in["monitor_slug"] == "failure_from_beat"
153153
assert check_in["status"] == "error"
154+
155+
156+
def test_placeholder():
157+
"""Forked test cannot be last in a module.
158+
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
159+
"""
160+
assert True

tests/integrations/celery/test_celery.py

+7
Original file line numberDiff line numberDiff line change
@@ -831,3 +831,10 @@ def test_send_task_wrapped(
831831
assert span["description"] == "very_creative_task_name"
832832
assert span["op"] == "queue.submit.celery"
833833
assert span["trace_id"] == kwargs["headers"]["sentry-trace"].split("-")[0]
834+
835+
836+
def test_placeholder():
837+
"""Forked test cannot be last in a module.
838+
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
839+
"""
840+
assert True

tests/integrations/django/test_cache_module.py

+7
Original file line numberDiff line numberDiff line change
@@ -626,3 +626,10 @@ def test_span_origin_cache(sentry_init, client, capture_events, use_django_cachi
626626
cache_span_found = True
627627

628628
assert cache_span_found
629+
630+
631+
def test_placeholder():
632+
"""Forked test cannot be last in a module.
633+
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
634+
"""
635+
assert True

tests/integrations/django/test_data_scrubbing.py

+7
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,10 @@ def test_scrub_django_custom_session_cookies_filtered(
8282
"csrf_secret": "[Filtered]",
8383
"foo": "bar",
8484
}
85+
86+
87+
def test_placeholder():
88+
"""Forked test cannot be last in a module.
89+
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
90+
"""
91+
assert True

tests/integrations/django/test_db_query_data.py

+7
Original file line numberDiff line numberDiff line change
@@ -524,3 +524,10 @@ def test_db_span_origin_executemany(sentry_init, client, capture_events):
524524

525525
assert event["contexts"]["trace"]["origin"] == "manual"
526526
assert event["spans"][0]["origin"] == "auto.db.django"
527+
528+
529+
def test_placeholder():
530+
"""Forked test cannot be last in a module.
531+
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
532+
"""
533+
assert True

tests/integrations/opentelemetry/test_experimental.py

+7
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,10 @@ def test_integration_not_enabled_if_option_is_missing(sentry_init, reset_integra
4545
):
4646
sentry_init()
4747
mocked_setup_once.assert_not_called()
48+
49+
50+
def test_placeholder():
51+
"""Forked test cannot be last in a module.
52+
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
53+
"""
54+
assert True

tests/integrations/ray/test_ray.py

+7
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,10 @@ def increment(self):
203203
== client_transaction["contexts"]["trace"]["trace_id"]
204204
== client_transaction["contexts"]["trace"]["trace_id"]
205205
)
206+
207+
208+
def test_placeholder():
209+
"""Forked test cannot be last in a module.
210+
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
211+
"""
212+
assert True

tests/test_metrics.py

+7
Original file line numberDiff line numberDiff line change
@@ -969,3 +969,10 @@ def test_disable_metrics_for_old_python_with_gevent(
969969

970970
assert sentry_sdk.get_client().metrics_aggregator is None
971971
assert not envelopes
972+
973+
974+
def test_placeholder():
975+
"""Forked test cannot be last in a module.
976+
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
977+
"""
978+
assert True

0 commit comments

Comments
 (0)