From 50ebfaf734f06f51fc618c37fa70f53de04def0a Mon Sep 17 00:00:00 2001 From: John Eskew Date: Tue, 5 Dec 2017 16:25:56 -0500 Subject: [PATCH 1/2] Add -Wd when running pytest to turn on deprecation warnings in Django 1.11 --- pavelib/utils/test/suites/pytest_suite.py | 4 ++-- tox.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pavelib/utils/test/suites/pytest_suite.py b/pavelib/utils/test/suites/pytest_suite.py index 7d48ace091..27f250a78c 100644 --- a/pavelib/utils/test/suites/pytest_suite.py +++ b/pavelib/utils/test/suites/pytest_suite.py @@ -134,7 +134,7 @@ class SystemTestSuite(PytestSuite): if self.django_toxenv: cmd = ['tox', '-e', self.django_toxenv, '--'] else: - cmd = ['pytest'] + cmd = ['python', '-Wd', '-m', 'pytest'] cmd.extend([ '--ds={}'.format('{}.envs.{}'.format(self.root, self.settings)), "--junitxml={}".format(self.xunit_report), @@ -223,7 +223,7 @@ class LibTestSuite(PytestSuite): if self.django_toxenv: cmd = ['tox', '-e', self.django_toxenv, '--'] else: - cmd = ['pytest'] + cmd = ['python', '-Wd', '-m', 'pytest'] cmd.extend([ "-p", "no:randomly", diff --git a/tox.ini b/tox.ini index 9687e3cb39..cbb93beabc 100644 --- a/tox.ini +++ b/tox.ini @@ -48,4 +48,4 @@ deps = -rrequirements/edx-sandbox/post.txt commands = - pytest {posargs} + python -Wd -m pytest {posargs} From 4bbc3aa37a135587000e77585f275a6262a15346 Mon Sep 17 00:00:00 2001 From: John Eskew Date: Wed, 6 Dec 2017 15:07:51 -0500 Subject: [PATCH 2/2] Turn on deprecation warnings post-Django 1.11 for bokchoy tests. --- pavelib/paver_tests/test_paver_bok_choy_cmds.py | 1 + pavelib/utils/test/suites/bokchoy_suite.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pavelib/paver_tests/test_paver_bok_choy_cmds.py b/pavelib/paver_tests/test_paver_bok_choy_cmds.py index 6eaf0a7ef1..6de264b719 100644 --- a/pavelib/paver_tests/test_paver_bok_choy_cmds.py +++ b/pavelib/paver_tests/test_paver_bok_choy_cmds.py @@ -41,6 +41,7 @@ class TestPaverBokChoyCmd(unittest.TestCase): "SELENIUM_DRIVER_LOG_DIR='{}/test_root/log{}'".format(REPO_DIR, shard_str), "VERIFY_XSS='{}'".format(verify_xss), "python", + "-Wd", "-m", "pytest", "{}/common/test/acceptance/{}".format(REPO_DIR, name), diff --git a/pavelib/utils/test/suites/bokchoy_suite.py b/pavelib/utils/test/suites/bokchoy_suite.py index 6dbe2ecb43..9b73a67a24 100644 --- a/pavelib/utils/test/suites/bokchoy_suite.py +++ b/pavelib/utils/test/suites/bokchoy_suite.py @@ -341,7 +341,8 @@ class BokChoyTestSuite(TestSuite): cmd.append("--rcfile={}".format(self.coveragerc)) else: cmd += [ - "python" + "python", + "-Wd", ] cmd += [ "-m",