Skip to content

Commit c174c97

Browse files
committed
Tidy up around testing behaviour
1 parent bcca6ee commit c174c97

File tree

6 files changed

+1203
-23
lines changed

6 files changed

+1203
-23
lines changed

.coveragerc

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
[run]
2-
branch = True
3-
include = wagtail_wordpress_import/*
4-
omit = */migrations/*,*/tests/*
5-
source=wagtail_wordpress_import
2+
source = src/wagtail_wordpress_import
3+
omit =
4+
*/migrations/*
5+
*/tests/*
6+
*/templates/*
7+
*/static/*
8+
*/static_src/*
9+
*/__pycache__/*
10+
*/__init__.py
611

712
[report]
8-
# Regexes for lines to exclude from consideration
913
exclude_lines =
10-
# Have to re-enable the standard pragma
1114
pragma: no cover
12-
13-
# Don't complain about missing debug-only code:
1415
def __repr__
15-
if self\.debug
16-
17-
# Don't complain if tests don't hit defensive assertion code:
18-
raise AssertionError
16+
def __str__
1917
raise NotImplementedError
20-
21-
# Don't complain if non-runnable code isn't run:
22-
if 0:
2318
if __name__ == .__main__.:
19+
pass
20+
raise ImportError
21+
22+
[html]
23+
directory = htmlcov
2424

25-
ignore_errors = True
25+
[xml]
26+
output = coverage.xml

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

pyproject.toml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "wagtail-wordpress-import"
7+
version = "0.3.0"
8+
description = "Import XML data into wagtail to create pages and content"
9+
readme = "README.md"
10+
authors = [
11+
{ name = "Nick Moreton", email = "[email protected]" }
12+
]
13+
license = { text = "BSD" }
14+
requires-python = ">=3.9"
15+
classifiers = [
16+
"Intended Audience :: Developers",
17+
"License :: OSI Approved :: MIT License",
18+
"Programming Language :: Python",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
25+
"Framework :: Django",
26+
"Framework :: Django :: 4.2",
27+
"Framework :: Django :: 5.1",
28+
"Framework :: Django :: 5.2",
29+
"Framework :: Wagtail",
30+
"Framework :: Wagtail :: 6",
31+
"Framework :: Wagtail :: 7",
32+
]
33+
dependencies = [
34+
"Django>=4.2",
35+
"Wagtail>=6.3",
36+
"lxml>=5.3.0,<5.4",
37+
"bleach>=4.1.0,<5",
38+
"prettytable>=3.16.0,<4",
39+
"shortcodes>=5.4.0,<6",
40+
"cached-property>=2.0.1,<3",
41+
"html5lib>=1.1,<2",
42+
]
43+
44+
[project.urls]
45+
Homepage = "https://github.com/torchbox/wagtail-wordpress-import"
46+
47+
[tool.hatch.build.targets.wheel]
48+
packages = ["src/wagtail_wordpress_import"]
49+
50+
[tool.hatch.build.targets.sdist]
51+
include = [
52+
"src/wagtail_wordpress_import",
53+
"LICENSE",
54+
"*.rst",
55+
"*.txt",
56+
"*.md",
57+
]
58+
exclude = [
59+
"**/__pycache__",
60+
"**/*.py[co]"
61+
]
62+
63+
[dependency-groups]
64+
dev = [
65+
"pre-commit>=4.2.0",
66+
"ruff>=0.11.9",
67+
]
68+
69+
[project.optional-dependencies]
70+
testing = [
71+
"coverage>=7.8.0",
72+
"responses==0.25.7",
73+
]

testmanage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from django.core.management import execute_from_command_line
1010

11-
os.environ["DJANGO_SETTINGS_MODULE"] = "wagtail_wordpress_import.test.settings"
11+
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
1212

1313

1414
def make_parser():
@@ -55,7 +55,7 @@ def runtests():
5555
try:
5656
execute_from_command_line(argv)
5757
finally:
58-
from wagtail_wordpress_import.test.settings import MEDIA_ROOT, STATIC_ROOT
58+
from tests.settings import MEDIA_ROOT, STATIC_ROOT
5959

6060
shutil.rmtree(STATIC_ROOT, ignore_errors=True)
6161
shutil.rmtree(MEDIA_ROOT, ignore_errors=True)

tox.ini

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,3 @@ deps =
4747
responses: responses>=0.25.7
4848
cached_property: cached-property>=2.0.1,<3
4949
html5lib: html5lib>=1.1,<2
50-
51-
[testenv:flake8]
52-
basepython=python3.9
53-
deps=flake8>=2.2.0
54-
commands=flake8 wagtail_wordpress_import

0 commit comments

Comments
 (0)