Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running tests using python 3.12 #724

Merged
merged 4 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8']
toxenv: [quality, django32, django42]
python-version: ['3.8', '3.12']
toxenv: [quality, django42]

steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
# diff-cover latest requires (pluggy>=0.13.1,<0.14.0) which conflicts with pytest which requires(pluggy>=0.12,<2.0.0)
# Using the same version of diff-cover which is being used currently in edx-platform to avoid this conflict.
diff-cover==4.0.0
lxml<5.0.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ def get_version(*file_paths):
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.12",
]
)
11 changes: 5 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38-django{32,42}, quality, docs
envlist = py{38,312}-django{42}, quality, docs

[pytest]
DJANGO_SETTINGS_MODULE = xblock.test.settings
Expand All @@ -8,9 +8,8 @@ filterwarnings = always
norecursedirs = .* docs requirements

[testenv]
deps =
django32: Django>=3.2,<4.0
django42: Django>=4.2,<5.0
deps =
django42: Django>=4.2,<4.3
-r requirements/test.txt
changedir = {envsitepackagesdir}
commands =
Expand All @@ -32,8 +31,8 @@ commands =
make html

[testenv:quality]
deps =
django32: Django>=3.2,<4.0
deps =
django42: Django>=4.2,<4.3
-r requirements/test.txt
changedir = {toxinidir}
commands =
Expand Down
2 changes: 1 addition & 1 deletion xblock/test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ class HasParent(XBlock):
block.parent = "some_parent_id"
parent = block.get_parent()
assert parent is not None
assert runtime.get_block.called_with("some_parent_id")
assert runtime.get_block.called

# Get the parent again. It will be the same parent, and we didn't call the
# runtime.
Expand Down
4 changes: 2 additions & 2 deletions xblock/test/test_user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def test_dummy_user_service_current_user():
assert current_user == user
assert current_user.full_name == "tester"
# assert that emails is an Iterable but not a string
assert isinstance(current_user.emails, collections.Iterable)
assert isinstance(current_user.emails, collections.abc.Iterable)
assert not isinstance(current_user.emails, (str, bytes))
# assert that opt_attrs is a Mapping
assert isinstance(current_user.opt_attrs, collections.Mapping)
assert isinstance(current_user.opt_attrs, collections.abc.Mapping)


def test_dummy_user_service_exception():
Expand Down
Loading