Skip to content

Commit

Permalink
Merge 769b729 into 272d62c
Browse files Browse the repository at this point in the history
  • Loading branch information
vinitkumar committed Jan 16, 2022
2 parents 272d62c + 769b729 commit f9dcf33
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ 3.6, 3.7, 3.8, 3.9, ] # latest release minus three
python-version: [ 3.6, 3.7, 3.8, 3.9, 3.10.0] # latest release minus three
requirements-file: [
django-2.2.txt,
django-3.0.txt,
Expand Down
13 changes: 11 additions & 2 deletions cms/test_utils/testcases.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,21 @@ def update(self, response):

def failUnlessWarns(self, category, message, f, *args, **kwargs):
warningsShown = []
cleanwarningsShown = []
result = _collectWarnings(warningsShown.append, f, *args, **kwargs)

if not warningsShown:
self.fail("No warnings emitted")
first = warningsShown[0]
for other in warningsShown[1:]:

for warning in warningsShown:
# this specific warning is present due to the way Django
# handle asyncio
# https://stackoverflow.com/questions/70303895/python-3-10-asyncio-gather-shows-deprecationwarning-there-is-no-current-event
if (warning.category != DeprecationWarning and warning.message != 'There is no current event loop'):
cleanwarningsShown.append(warning)

first = cleanwarningsShown[0]
for other in cleanwarningsShown[1:]:
if ((other.message, other.category) != (first.message, first.category)):
self.fail("Can't handle different warnings")

Expand Down
2 changes: 1 addition & 1 deletion cms/tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,12 +891,12 @@ def test_page_attribute_warns(self):
def get_page(plugin):
return plugin.page

print(DontUsePageAttributeWarning)
self.assertWarns(
DontUsePageAttributeWarning,
"Don't use the page attribute on CMSPlugins! CMSPlugins are not guaranteed to have a page associated with them!",
get_page, a
)

with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
a.page
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MarkupSafe
Pygments
furo
Sphinx>4
Sphinx>=4.2.0
sphinx-copybutton
sphinxext-opengraph
sphinxcontrib-spelling
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.9
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile
Expand Down Expand Up @@ -90,7 +90,7 @@ snowballstemmer==2.1.0
# via sphinx
soupsieve==2.2.1
# via beautifulsoup4
sphinx==4.0.2
sphinx==4.2.0
# via
# -r requirements.in
# furo
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
Expand Down
2 changes: 1 addition & 1 deletion test_requirements/requirements_base.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
coverage>=4
python-coveralls>2.5.0
unittest-xml-reporting==1.11.0
Pillow==5.2.0
Pillow==8.3.2
django-treebeard>=4.3
argparse
dj-database-url
Expand Down

0 comments on commit f9dcf33

Please sign in to comment.