summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--awx_collection/test/awx/test_schedule.py1
2 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index dba1e0844b..00877f6740 100644
--- a/Makefile
+++ b/Makefile
@@ -378,7 +378,11 @@ test_collection:
@if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \
fi; \
- PYTHONPATH=$PYTHONPATH:/usr/lib/python3.6/site-packages py.test $(COLLECTION_TEST_DIRS)
+ PYTHONPATH=$(PYTHONPATH):$(VENV_BASE)/awx/lib/python3.6/site-packages:/usr/lib/python3.6/site-packages py.test $(COLLECTION_TEST_DIRS)
+ # The python path needs to be modified so that the tests can find Ansible within the container
+ # First we will use anything expility set as PYTHONPATH
+ # Second we will load any libraries out of the virtualenv (if it's unspecified that should be ok because python should not load out of an empty directory)
+ # Finally we will add the system path so that the tests can find the ansible libraries
flake8_collection:
flake8 awx_collection/ # Different settings, in main exclude list
diff --git a/awx_collection/test/awx/test_schedule.py b/awx_collection/test/awx/test_schedule.py
index 3d829fe8bc..3db6249b33 100644
--- a/awx_collection/test/awx/test_schedule.py
+++ b/awx_collection/test/awx/test_schedule.py
@@ -8,6 +8,7 @@ from ansible.errors import AnsibleError
from awx.main.models import Schedule
from awx.api.serializers import SchedulePreviewSerializer
+
@pytest.mark.django_db
def test_create_schedule(run_module, job_template, admin_user):
my_rrule = 'DTSTART;TZID=Zulu:20200416T034507 RRULE:FREQ=MONTHLY;INTERVAL=1'