Skip to content

Commit

Permalink
build: Remove Pytest pin
Browse files Browse the repository at this point in the history
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
  • Loading branch information
szokeasaurusrex committed Oct 28, 2024
1 parent ec88aa9 commit b0d9760
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion requirements-devenv.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-r requirements-linting.txt
-r requirements-testing.txt
mockupdb # required by `pymongo` tests that are enabled by `pymongo` from linter requirements
pytest<7.0.0 # https://github.com/pytest-dev/pytest/issues/9621; see tox.ini
pytest
pytest-asyncio
1 change: 1 addition & 0 deletions sentry_sdk/integrations/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def _emit(self, record):
}

else:
breakpoint()
event["logentry"] = {
"message": to_string(record.msg),
"params": record.args,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,10 @@ def test_task():
assert check_in["type"] == "check_in"
assert check_in["monitor_slug"] == "failure_from_beat"
assert check_in["status"] == "error"


def test_placeholder():
"""Forked test cannot be last in a module.
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
"""
assert True
7 changes: 7 additions & 0 deletions tests/integrations/celery/test_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,3 +831,10 @@ def test_send_task_wrapped(
assert span["description"] == "very_creative_task_name"
assert span["op"] == "queue.submit.celery"
assert span["trace_id"] == kwargs["headers"]["sentry-trace"].split("-")[0]


def test_placeholder():
"""Forked test cannot be last in a module.
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
"""
assert True
7 changes: 7 additions & 0 deletions tests/integrations/django/test_cache_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,3 +626,10 @@ def test_span_origin_cache(sentry_init, client, capture_events, use_django_cachi
cache_span_found = True

assert cache_span_found


def test_placeholder():
"""Forked test cannot be last in a module.
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
"""
assert True
7 changes: 7 additions & 0 deletions tests/integrations/django/test_data_scrubbing.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,10 @@ def test_scrub_django_custom_session_cookies_filtered(
"csrf_secret": "[Filtered]",
"foo": "bar",
}


def test_placeholder():
"""Forked test cannot be last in a module.
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
"""
assert True
7 changes: 7 additions & 0 deletions tests/integrations/django/test_db_query_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,3 +524,10 @@ def test_db_span_origin_executemany(sentry_init, client, capture_events):

assert event["contexts"]["trace"]["origin"] == "manual"
assert event["spans"][0]["origin"] == "auto.db.django"


def test_placeholder():
"""Forked test cannot be last in a module.
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
"""
assert True
7 changes: 7 additions & 0 deletions tests/integrations/opentelemetry/test_experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@ def test_integration_not_enabled_if_option_is_missing(sentry_init, reset_integra
):
sentry_init()
mocked_setup_once.assert_not_called()


def test_placeholder():
"""Forked test cannot be last in a module.
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
"""
assert True
7 changes: 7 additions & 0 deletions tests/integrations/ray/test_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,10 @@ def increment(self):
== client_transaction["contexts"]["trace"]["trace_id"]
== client_transaction["contexts"]["trace"]["trace_id"]
)


def test_placeholder():
"""Forked test cannot be last in a module.
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
"""
assert True
7 changes: 7 additions & 0 deletions tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,3 +969,10 @@ def test_disable_metrics_for_old_python_with_gevent(

assert sentry_sdk.get_client().metrics_aggregator is None
assert not envelopes


def test_placeholder():
"""Forked test cannot be last in a module.
See https://github.com/pytest-dev/pytest-forked/issues/67#issuecomment-1964718720.
"""
assert True

0 comments on commit b0d9760

Please sign in to comment.