From e54cdcb6d0be903aca33caa95d8480e6a6d4fa2c Mon Sep 17 00:00:00 2001 From: nrthbnd Date: Thu, 14 Dec 2023 21:10:54 +0300 Subject: [PATCH] Add pytest-django (#45) --- poetry.lock | 84 +++++++++++-------------------------- pyproject.toml | 6 ++- requirements/develop.txt | 7 +--- requirements/production.txt | 7 +--- 4 files changed, 33 insertions(+), 71 deletions(-) diff --git a/poetry.lock b/poetry.lock index 18e24c67..294b3d71 100644 --- a/poetry.lock +++ b/poetry.lock @@ -29,34 +29,6 @@ files = [ lazy-object-proxy = ">=1.4.0" wrapt = {version = ">=1.14,<2", markers = "python_version >= \"3.11\""} -[[package]] -name = "atomicwrites" -version = "1.4.1" -description = "Atomic file writes." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "atomicwrites-1.4.1.tar.gz", hash = "sha256:81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11"}, -] - -[[package]] -name = "attrs" -version = "23.1.0" -description = "Classes Without Boilerplate" -optional = false -python-versions = ">=3.7" -files = [ - {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, - {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, -] - -[package.extras] -cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] -dev = ["attrs[docs,tests]", "pre-commit"] -docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] -tests = ["attrs[tests-no-zope]", "zope-interface"] -tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] - [[package]] name = "certifi" version = "2023.11.17" @@ -735,17 +707,6 @@ nodeenv = ">=0.11.1" pyyaml = ">=5.1" virtualenv = ">=20.10.0" -[[package]] -name = "py" -version = "1.11.0" -description = "library with cross-python path, ini-parsing, io, code, log facilities" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -files = [ - {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, - {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, -] - [[package]] name = "pycodestyle" version = "2.11.1" @@ -770,27 +731,41 @@ files = [ [[package]] name = "pytest" -version = "6.2.5" +version = "7.4.3" description = "pytest: simple powerful testing with Python" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"}, - {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"}, + {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, + {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, ] [package.dependencies] -atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} -attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" -py = ">=1.8.2" -toml = "*" [package.extras] -testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "pytest-django" +version = "4.7.0" +description = "A Django plugin for pytest." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-django-4.7.0.tar.gz", hash = "sha256:92d6fd46b1d79b54fb6b060bbb39428073396cec717d5f2e122a990d4b6aa5e8"}, + {file = "pytest_django-4.7.0-py3-none-any.whl", hash = "sha256:4e1c79d5261ade2dd58d91208017cd8f62cb4710b56e012ecd361d15d5d662a2"}, +] + +[package.dependencies] +pytest = ">=7.0.0" + +[package.extras] +docs = ["sphinx", "sphinx-rtd-theme"] +testing = ["Django", "django-configurations (>=2.0)"] [[package]] name = "python-docx" @@ -919,17 +894,6 @@ dev = ["build", "flake8"] doc = ["sphinx"] test = ["pytest", "pytest-cov"] -[[package]] -name = "toml" -version = "0.10.2" -description = "Python Library for Tom's Obvious, Minimal Language" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -files = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] - [[package]] name = "types-openpyxl" version = "3.1.0.32" @@ -1103,4 +1067,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "53783da18241870a83ce74c6d1e39719af8f296fd8082075322ce671bd3783b9" +content-hash = "33b15b5351144984f9c4eddf307c221188b055f0aa4a258a6b5ea7f80124339e" diff --git a/pyproject.toml b/pyproject.toml index db066214..3cb19e48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ types-openpyxl = "^3.1.0.24" openpyxl-stubs = "^0.1.25" click = "^8.1.7" wrapt = "^1.16.0" -pytest = "^6.2" +pytest-django = "^4.7.0" [tool.poetry.group.dev.dependencies] isort = "^5.12.0" @@ -62,3 +62,7 @@ django_settings_module = "adaptive_hockey_federation.core.config.dev_settings" [tool.poetry.scripts] parser = "adaptive_hockey_federation.parser.parser:parsing_file" + +[tool.pytest.ini_options] +DJANGO_SETTINGS_MODULE = "adaptive_hockey_federation.core.config.test_settings" +python_files = ["test_*.py"] diff --git a/requirements/develop.txt b/requirements/develop.txt index 0c7246cf..5bdb5b2a 100644 --- a/requirements/develop.txt +++ b/requirements/develop.txt @@ -1,6 +1,4 @@ asgiref==3.7.2 ; python_version >= "3.11" and python_version < "4.0" -atomicwrites==1.4.1 ; python_version >= "3.11" and python_version < "4.0" and sys_platform == "win32" -attrs==23.1.0 ; python_version >= "3.11" and python_version < "4.0" cfgv==3.4.0 ; python_version >= "3.11" and python_version < "4.0" click==8.1.7 ; python_version >= "3.11" and python_version < "4.0" colorama==0.4.6 ; python_version >= "3.11" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32") @@ -21,12 +19,11 @@ packaging==23.2 ; python_version >= "3.11" and python_version < "4.0" platformdirs==4.1.0 ; python_version >= "3.11" and python_version < "4.0" pluggy==1.3.0 ; python_version >= "3.11" and python_version < "4.0" pre-commit==3.5.0 ; python_version >= "3.11" and python_version < "4.0" -py==1.11.0 ; python_version >= "3.11" and python_version < "4.0" -pytest==6.2.5 ; python_version >= "3.11" and python_version < "4.0" +pytest-django==4.7.0 ; python_version >= "3.11" and python_version < "4.0" +pytest==7.4.3 ; python_version >= "3.11" and python_version < "4.0" pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "4.0" setuptools==69.0.2 ; python_version >= "3.11" and python_version < "4.0" sqlparse==0.4.4 ; python_version >= "3.11" and python_version < "4.0" -toml==0.10.2 ; python_version >= "3.11" and python_version < "4.0" types-openpyxl==3.1.0.32 ; python_version >= "3.11" and python_version < "4.0" typing-extensions==4.9.0 ; python_version >= "3.11" and python_version < "4.0" tzdata==2023.3 ; python_version >= "3.11" and python_version < "4.0" and sys_platform == "win32" diff --git a/requirements/production.txt b/requirements/production.txt index 5334742a..1df4e848 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -1,6 +1,4 @@ asgiref==3.7.2 ; python_version >= "3.11" and python_version < "4.0" -atomicwrites==1.4.1 ; python_version >= "3.11" and python_version < "4.0" and sys_platform == "win32" -attrs==23.1.0 ; python_version >= "3.11" and python_version < "4.0" click==8.1.7 ; python_version >= "3.11" and python_version < "4.0" colorama==0.4.6 ; python_version >= "3.11" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32") django==4.2.8 ; python_version >= "3.11" and python_version < "4.0" @@ -13,10 +11,9 @@ openpyxl-stubs==0.1.25 ; python_version >= "3.11" and python_version < "4.0" openpyxl==3.1.2 ; python_version >= "3.11" and python_version < "4.0" packaging==23.2 ; python_version >= "3.11" and python_version < "4.0" pluggy==1.3.0 ; python_version >= "3.11" and python_version < "4.0" -py==1.11.0 ; python_version >= "3.11" and python_version < "4.0" -pytest==6.2.5 ; python_version >= "3.11" and python_version < "4.0" +pytest-django==4.7.0 ; python_version >= "3.11" and python_version < "4.0" +pytest==7.4.3 ; python_version >= "3.11" and python_version < "4.0" sqlparse==0.4.4 ; python_version >= "3.11" and python_version < "4.0" -toml==0.10.2 ; python_version >= "3.11" and python_version < "4.0" types-openpyxl==3.1.0.32 ; python_version >= "3.11" and python_version < "4.0" typing-extensions==4.9.0 ; python_version >= "3.11" and python_version < "4.0" tzdata==2023.3 ; python_version >= "3.11" and python_version < "4.0" and sys_platform == "win32"