Repository: samuelcolvin/foxglove (language: python)

Issue:
Missing files in 0.0.37 release
In foxglove-web 0.0.36 there were `testing.py` and `test_server.py` files in the package distribution. In foxglove-web 0.0.37 those files are missing.

This affects `hooky` testing suite as it uses `TestClient` and `DummyServer`.

It's worth mentioning that files are present in `tar.gz` distribution but still won't be installed from it.


Discussion / hints:
Okay, let's fix and make a new release.

Fix patch:
diff --git a/.gitignore b/.gitignore
index 10a8737..2c6b5f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 /.idea/
+/.vscode/
 /env/
 /env*/
 /env-minimal/
diff --git a/pyproject.toml b/pyproject.toml
index c5d2155..a862ad6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,6 +5,9 @@ build-backend = 'hatchling.build'
 [tool.hatch.version]
 path = 'foxglove/version.py'
 
+[tool.hatch.build]
+packages = ["foxglove"]
+
 [project]
 name = 'foxglove-web'
 description = 'Tools for FastAPI'


Test patch:
diff --git a/foxglove/testing/__init__.py b/foxglove/testing/__init__.py
new file mode 100644
index 0000000..fd68b87
--- /dev/null
+++ b/foxglove/testing/__init__.py
@@ -0,0 +1,4 @@
+from .test_client import TestClient
+from .test_server import DummyServer, Offline, create_dummy_server
+
+__all__ = 'create_dummy_server', 'DummyServer', 'Offline', 'TestClient'
diff --git a/foxglove/testing.py b/foxglove/testing/test_client.py
similarity index 100%
rename from foxglove/testing.py
rename to foxglove/testing/test_client.py
diff --git a/foxglove/test_server.py b/foxglove/testing/test_server.py
similarity index 98%
rename from foxglove/test_server.py
rename to foxglove/testing/test_server.py
index c5ad0c0..8b9527e 100644
--- a/foxglove/test_server.py
+++ b/foxglove/testing/test_server.py
@@ -12,8 +12,6 @@
 from aiohttp.web_response import Response, json_response
 from async_timeout import timeout
 
-__all__ = 'create_dummy_server', 'DummyServer', 'Offline'
-
 
 async def return_any_status(request):
     status = int(request.match_info['status'])
diff --git a/tests/conftest.py b/tests/conftest.py
index 253cf28..e1b5152 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -10,8 +10,7 @@
 from foxglove import glove
 from foxglove.db import lenient_conn, prepare_database
 from foxglove.db.helpers import DummyPgPool, SyncDb
-from foxglove.test_server import create_dummy_server
-from foxglove.testing import TestClient
+from foxglove.testing import TestClient, create_dummy_server
 
 commit_transactions = 'KEEP_DB' in os.environ
 
diff --git a/tests/test_client.py b/tests/test_client.py
index ef4f784..9ddd228 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -14,7 +14,7 @@ def test_post_index(client: Client):
 
 
 def test_request_error(client: Client, mocker):
-    fail_mock = mocker.patch('foxglove.testing.pytest.fail')
+    fail_mock = mocker.patch('foxglove.testing.test_client.pytest.fail')
     client.post_json('/')
     fail_mock.called_once()
 
diff --git a/tests/test_dummy_server.py b/tests/test_dummy_server.py
index 37d3e0d..671506f 100644
--- a/tests/test_dummy_server.py
+++ b/tests/test_dummy_server.py
@@ -3,7 +3,7 @@
 
 import pytest
 
-from foxglove.test_server import DummyServer, Offline
+from foxglove.testing import DummyServer, Offline
 
 
 async def test_dummy_get(dummy_server: DummyServer, glove):
diff --git a/tests/test_recaptcha.py b/tests/test_recaptcha.py
index f35d96e..8b2c51b 100644
--- a/tests/test_recaptcha.py
+++ b/tests/test_recaptcha.py
@@ -4,8 +4,7 @@
 
 from foxglove import exceptions
 from foxglove.recaptcha import check_recaptcha
-from foxglove.test_server import DummyServer
-from foxglove.testing import TestClient as Client
+from foxglove.testing import DummyServer, TestClient as Client
 
 
 def test_success(client: Client, settings, dummy_server: DummyServer, caplog):