File tree Expand file tree Collapse file tree 2 files changed +11
-18
lines changed
pulpcore/tests/functional Expand file tree Collapse file tree 2 files changed +11
-18
lines changed Original file line number Diff line number Diff line change 33import pytest
44
55
6- @pytest .mark .parallel
7- def test_debugging (
8- file_bindings ,
9- file_content_unit_with_name_factory ,
10- file_repo ,
11- monitor_task ,
12- ):
13- i = 0
14- content_unit = file_content_unit_with_name_factory (f"{ i } .iso" )
15- file_bindings .RepositoriesFileApi .modify (
16- file_repo .pulp_href , {"add_content_units" : [content_unit .pulp_href ]}
17- ).task
18-
19-
206@pytest .mark .parallel
217def test_repo_version_pagination (
228 file_bindings ,
Original file line number Diff line number Diff line change 1313
1414
1515@pytest .fixture (autouse = True )
16- def django_connection_reset (django_db_blocker ):
16+ def django_connection_reset (request ):
1717 # django_db_blocker is from pytest-django. We don't want it to try to safeguard
1818 # us from using our functional Pulp instance.
1919 # https://pytest-django.readthedocs.io/en/latest/database.html#django-db-blocker
20- django_db_blocker .unblock ()
20+ pytest_django_installed = False
21+ try :
22+ django_db_blocker = request .getfixturevalue ("django_db_blocker" )
23+ django_db_blocker .unblock ()
24+ pytest_django_installed = True
25+ except pytest .FixtureLookupError :
26+ pass
2127
2228 # If we dont' reset the connections we'll get interference between tests,
2329 # as listen/notify is connection based.
2430 from django .db import connections
2531
2632 connections .close_all ()
2733 yield
28- django_db_blocker .block ()
34+ if pytest_django_installed :
35+ django_db_blocker .block ()
2936
3037
3138def test_postgres_pubsub ():
@@ -61,7 +68,7 @@ class PubsubMessage(NamedTuple):
6168
6269
6370@pytest .fixture
64- def pubsub_backend (django_db_blocker ):
71+ def pubsub_backend ():
6572 from pulpcore .tasking import pubsub
6673
6774 return pubsub .PostgresPubSub
You can’t perform that action at this time.
0 commit comments