From 50dadaad48839984650d00bd7b3bcfa763f144cf Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Fri, 29 Mar 2024 19:07:31 +0000 Subject: [PATCH 1/2] build: Remove tests/ stub; make `make test-all` work right - The `tests/__init__.py` create/delete thing seems to have been a workaround for something that's no longer relevant, so just remove it. - The `test-all` target needed to depend on `clean` so that `build/lib` wouldn't stick around and confuse pytest, and the recipe needed to be pruned down to just `tox` because otherwise we'd run the quality checks twice. (`quality` is in the tox.ini default env list.) --- .gitignore | 3 --- Makefile | 3 +-- tests/test_models.py | 4 ---- tox.ini | 12 +++++------- 4 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 tests/test_models.py diff --git a/.gitignore b/.gitignore index ef2b4aea..6e3fb1ee 100644 --- a/.gitignore +++ b/.gitignore @@ -69,9 +69,6 @@ docs/edx_django_utils.*.rst requirements/private.in requirements/private.txt -# tox environment temporary artifacts -tests/__init__.py - # Development task artifacts default.db diff --git a/Makefile b/Makefile index e1c0ee09..b9fe60a5 100644 --- a/Makefile +++ b/Makefile @@ -74,8 +74,7 @@ test: clean ## run tests in the current virtualenv diff_cover: test ## find diff lines that need test coverage diff-cover coverage.xml -test-all: ## run tests on every supported Python/Django combination - tox -e quality +test-all: clean ## run quality checks as well as tests on every supported Python/Django combination tox validate: quality test ## run tests and quality checks diff --git a/tests/test_models.py b/tests/test_models.py deleted file mode 100644 index 048d3464..00000000 --- a/tests/test_models.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python -""" -Tests for the `edx-django-utils` models module. -""" diff --git a/tox.ini b/tox.ini index 7aa97191..db70d613 100644 --- a/tox.ini +++ b/tox.ini @@ -76,12 +76,10 @@ deps = -r{toxinidir}/requirements/quality.txt setuptools commands = - touch tests/__init__.py - pylint edx_django_utils tests test_utils manage.py setup.py - rm tests/__init__.py - pycodestyle edx_django_utils tests manage.py setup.py - pydocstyle edx_django_utils tests manage.py setup.py - isort --check-only --diff tests test_utils edx_django_utils manage.py setup.py test_settings.py + pylint edx_django_utils test_utils manage.py setup.py + pycodestyle edx_django_utils manage.py setup.py + pydocstyle edx_django_utils manage.py setup.py + isort --check-only --diff test_utils edx_django_utils manage.py setup.py test_settings.py make selfcheck [testenv:isort] @@ -90,4 +88,4 @@ allowlist_externals = deps = -r{toxinidir}/requirements/quality.txt commands = - isort tests test_utils edx_django_utils manage.py setup.py test_settings.py + isort test_utils edx_django_utils manage.py setup.py test_settings.py From de46989f93d61e3145d6a05ff858681efbddbe57 Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Wed, 3 Apr 2024 14:17:34 +0000 Subject: [PATCH 2/2] fixup! Remove test_utils as well (unused, from cookiecutter) --- test_utils/__init__.py | 7 ------- tox.ini | 6 +++--- 2 files changed, 3 insertions(+), 10 deletions(-) delete mode 100644 test_utils/__init__.py diff --git a/test_utils/__init__.py b/test_utils/__init__.py deleted file mode 100644 index fd05563e..00000000 --- a/test_utils/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -""" -Test utilities. - -Since py.test discourages putting __init__.py into test directory (i.e. making tests a package) -one cannot import from anywhere under tests folder. However, some utility classes/methods might be useful -in multiple test modules (i.e. factoryboy factories, base test classes). So this package is the place to put them. -""" diff --git a/tox.ini b/tox.ini index db70d613..f1e626d9 100644 --- a/tox.ini +++ b/tox.ini @@ -76,10 +76,10 @@ deps = -r{toxinidir}/requirements/quality.txt setuptools commands = - pylint edx_django_utils test_utils manage.py setup.py + pylint edx_django_utils manage.py setup.py pycodestyle edx_django_utils manage.py setup.py pydocstyle edx_django_utils manage.py setup.py - isort --check-only --diff test_utils edx_django_utils manage.py setup.py test_settings.py + isort --check-only --diff edx_django_utils manage.py setup.py test_settings.py make selfcheck [testenv:isort] @@ -88,4 +88,4 @@ allowlist_externals = deps = -r{toxinidir}/requirements/quality.txt commands = - isort test_utils edx_django_utils manage.py setup.py test_settings.py + isort edx_django_utils manage.py setup.py test_settings.py