Skip to content

Commit 1d79176

Browse files
authored
First Pass at upgrading the test runner to Python 3.10 (#105)
* Changed Dockerfile to use python:3.10.6-slim * Regenerated and edited the results.json for example-empty-file and example-syntax-error golden tests * Updated and pinned versions for pytest and tomi in requirements.txt * re-tested all practice and concept exercise exampe soluitions against test files * re-tested specific error fencing scenarios for Lasagna and Classes exercises
1 parent cfac626 commit 1d79176

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim
1+
FROM python:3.10.6-slim
22

33
COPY requirements.txt /requirements.txt
44

@@ -15,3 +15,4 @@ COPY . /opt/test-runner
1515
WORKDIR /opt/test-runner
1616

1717
ENTRYPOINT [ "/opt/test-runner/bin/run.sh" ]
18+

requirements.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# cmccandless: Breaking changes in pytest 5.4.0
2-
# Changelog: https://docs.pytest.org/en/stable/changelog.html#pytest-5-4-0-2020-03-12
3-
pytest
1+
pytest~=7.1.2
42
pytest-subtests~=0.5.0
5-
tomli
3+
tomli~=2.0.1

test/example-empty-file/results.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": 3,
33
"status": "error",
4-
"message": " ImportError while importing test module './test/example-empty-file/example_empty_file_test.py'.\nHint: make sure your test modules/packages have valid Python names.\nTraceback:\n/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\ntest/example-empty-file/example_empty_file_test.py:4: in <module>\n from example_empty_file import hello\nE ImportError: cannot import name 'hello' from 'example_empty_file' (./test/example-empty-file/example_empty_file.py)",
4+
"message": " ImportError while importing test module './test/example-empty-file/example_empty_file_test.py'.\nHint: make sure your test modules/packages have valid Python names.\nTraceback:\n/usr/local/lib/python3.10/importlib/__init__.py:126: in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\ntest/example-empty-file/example_empty_file_test.py:4: in <module>\n from example_empty_file import hello\nE ImportError: cannot import name 'hello' from 'example_empty_file' (./test/example-empty-file/example_empty_file.py)",
55
"tests": []
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": 3,
33
"status": "error",
4-
"message": " .usr.local.lib.python3.9.site-packages._pytest.python.py:608: in _importtestmodule\n mod = import_path(self.path, mode=importmode, root=self.config.rootpath)\n.usr.local.lib.python3.9.site-packages._pytest.pathlib.py:533: in import_path\n importlib.import_module(module_name)\n.usr.local.lib.python3.9.importlib.__init__.py:127: in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n<frozen importlib._bootstrap>:1030: in _gcd_import\n ???\n<frozen importlib._bootstrap>:1007: in _find_and_load\n ???\n<frozen importlib._bootstrap>:986: in _find_and_load_unlocked\n ???\n<frozen importlib._bootstrap>:680: in _load_unlocked\n ???\n.usr.local.lib.python3.9.site-packages._pytest.assertion.rewrite.py:168: in exec_module\n exec(co, module.__dict__)\n.solution.example_syntax_error_test.py:4: in <module>\n from example_syntax_error import hello\nE File \".solution.example_syntax_error.py\", line 3\nE def hello();\nE ^\nE SyntaxError: invalid syntax",
4+
"message": " /usr/local/lib/python3.10/site-packages/_pytest/python.py:608: in _importtestmodule\n mod = import_path(self.path, mode=importmode, root=self.config.rootpath)\n/usr/local/lib/python3.10/site-packages/_pytest/pathlib.py:533: in import_path\n importlib.import_module(module_name)\n/usr/local/lib/python3.10/importlib/__init__.py:126: in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n<frozen importlib._bootstrap>:1050: in _gcd_import\n ???\n<frozen importlib._bootstrap>:1027: in _find_and_load\n ???\n<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked\n ???\n<frozen importlib._bootstrap>:688: in _load_unlocked\n ???\n/usr/local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:168: in exec_module\n exec(co, module.__dict__)\ntest/example-syntax-error/example_syntax_error_test.py:4: in <module>\n from example_syntax_error import hello\nE File \"./test/example-syntax-error/example_syntax_error.py\", line 3\nE def hello();\nE ^\nE SyntaxError: expected ':'",
55
"tests": []
66
}

0 commit comments

Comments
 (0)