pytest-postgresql 6.1.1__tar.gz → 7.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/AUTHORS.rst +1 -1
  2. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/CHANGES.rst +99 -43
  3. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/CONTRIBUTING.rst +16 -6
  4. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/COPYING +1 -1
  5. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/COPYING.lesser +1 -1
  6. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/PKG-INFO +57 -51
  7. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/README.rst +48 -42
  8. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pyproject.toml +12 -13
  9. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/__init__.py +1 -1
  10. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/config.py +4 -0
  11. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/executor.py +2 -2
  12. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/factories/client.py +8 -21
  13. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/factories/noprocess.py +6 -2
  14. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/factories/process.py +34 -5
  15. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/janitor.py +2 -2
  16. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/loader.py +1 -1
  17. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/plugin.py +21 -0
  18. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/PKG-INFO +57 -51
  19. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/requires.txt +2 -2
  20. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/tests/test_executor.py +2 -2
  21. pytest_postgresql-7.0.0/tests/test_postgres_options_plugin.py +123 -0
  22. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/tests/test_postgresql.py +3 -12
  23. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/tests/test_template_database.py +1 -0
  24. pytest_postgresql-6.1.1/tests/test_postgres_options_plugin.py +0 -43
  25. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/MANIFEST.in +0 -0
  26. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/exceptions.py +0 -0
  27. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/executor_noop.py +0 -0
  28. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/factories/__init__.py +0 -0
  29. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/py.typed +0 -0
  30. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql/retry.py +0 -0
  31. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/SOURCES.txt +0 -0
  32. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/dependency_links.txt +0 -0
  33. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/entry_points.txt +0 -0
  34. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/top_level.txt +0 -0
  35. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/pytest_postgresql.egg-info/zip-safe +0 -0
  36. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/setup.cfg +0 -0
  37. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/tests/test_janitor.py +0 -0
  38. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/tests/test_loader.py +0 -0
  39. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/tests/test_noopexecutor.py +0 -0
  40. {pytest_postgresql-6.1.1 → pytest_postgresql-7.0.0}/tests/test_version.py +0 -0
@@ -17,4 +17,4 @@ of pytest-postgresql along its history.
17
17
  * Donald Stufft
18
18
  * Will Vaughn
19
19
  * Hugo (hugovk)
20
- * Damian Skrzypczak
20
+ * Damian Skrzypczak
@@ -3,13 +3,69 @@ CHANGELOG
3
3
 
4
4
  .. towncrier release notes start
5
5
 
6
+ 7.0.0 (2025-02-23)
7
+ ==================
8
+
9
+ Breaking changes
10
+ ----------------
11
+
12
+ - Drop support for load parameter from client fixtures. This can be easily replaced by creating intermediary fixture between test and client fixture. (`#1087 <https://github.com/dbfixtures/pytest-postgresql/issues/1087>`__)
13
+ - Stop supporting Python 3.8 as it already reached EOL
14
+
15
+
16
+ Bugfixes
17
+ --------
18
+
19
+ - Passing all environment variables to the initdb.
20
+
21
+ This helps the cases where og_ctl is replaced by custom shell script
22
+ making additional calls, and needs all the variables, that ie server process gets. (`#1076 <https://github.com/dbfixtures/pytest-postgresql/issues/1076>`__)
23
+
24
+
25
+ Features
26
+ --------
27
+
28
+ - If a test run ended in an error that prevented proper test cleanup,
29
+ developer can now use `--postgresql-drop-test-database` command line flag,
30
+ to delete database from noproc fixture at the start. (`#265 <https://github.com/dbfixtures/pytest-postgresql/issues/265>`__)
31
+ - DatabaseJanitor.cursor now accepts optional parameter dbname, which defaults to `postgres`
32
+
33
+ This database name is used to make connection to and return a cursor. (`#265 <https://github.com/dbfixtures/pytest-postgresql/issues/265>`__)
34
+ - When running tests with xdist, pytest-postgresql now attempts to detect random ports
35
+ selected by other nodes by writing down a .port file in session temporary directory.
36
+
37
+ The number of tries it attempts to select unused port is configurable,
38
+ and defaults to 0.
39
+
40
+ In case pytest-postgresql won't be able to select unused port,
41
+ PortForException is thrown with appropriate message. (`#872 <https://github.com/dbfixtures/pytest-postgresql/issues/872>`__)
42
+ - Mark Python 3.13 as supported.
43
+
44
+
45
+ Miscellaneus
46
+ ------------
47
+
48
+ - `#707 <https://github.com/dbfixtures/pytest-postgresql/issues/707>`__, `#895 <https://github.com/dbfixtures/pytest-postgresql/issues/895>`__, `#1047 <https://github.com/dbfixtures/pytest-postgresql/issues/1047>`__, `#1048 <https://github.com/dbfixtures/pytest-postgresql/issues/1048>`__, `#1055 <https://github.com/dbfixtures/pytest-postgresql/issues/1055>`__, `#1061 <https://github.com/dbfixtures/pytest-postgresql/issues/1061>`__, `#1062 <https://github.com/dbfixtures/pytest-postgresql/issues/1062>`__, `#1063 <https://github.com/dbfixtures/pytest-postgresql/issues/1063>`__, `#1081 <https://github.com/dbfixtures/pytest-postgresql/issues/1081>`__
49
+ - Add PostgreSQL 17 to CI and drop 12
50
+ - Add [bot] suffix to the pre-commit actor.
51
+ - Adjust links after repository transfer
52
+ - Adjust workflows for actions-reuse 3.0.1
53
+ - Fix DatabaseJanitor documentation.
54
+ - In Python 3.13, usage of a positional argument for `maxsplit` has been
55
+ formally deprecated.
56
+ Update code to use keyword argument `maxsplit` instead of positional.
57
+ - Skip local hooks from ci
58
+ - Skip newsfragment checks for pre-commit actor.
59
+ - Update pre-commit configuration to use ruff instead of flake8/pydocstyle
60
+
61
+
6
62
  6.1.1 (2024-09-05)
7
63
  ==================
8
64
 
9
65
  Bugfixes
10
66
  --------
11
67
 
12
- - Set minimum version of `port-for` dependecy in pyproject.toml for client installations. (`#1015 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/1015>`__)
68
+ - Set minimum version of `port-for` dependecy in pyproject.toml for client installations. (`#1015 <https://github.com/dbfixtures/pytest-postgresql/issues/1015>`__)
13
69
 
14
70
 
15
71
  6.1.0 (2024-09-04)
@@ -18,13 +74,13 @@ Bugfixes
18
74
  Features
19
75
  --------
20
76
 
21
- - add support for \\ character in pytest temporary path (`#982 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/982>`__)
77
+ - add support for \\ character in pytest temporary path (`#982 <https://github.com/dbfixtures/pytest-postgresql/issues/982>`__)
22
78
 
23
79
 
24
80
  Miscellaneus
25
81
  ------------
26
82
 
27
- - Add test for `PR #965 <https://github.com/ClearcodeHQ/pytest-postgresql/pull/965>`_
83
+ - Add test for `PR #965 <https://github.com/dbfixtures/pytest-postgresql/pull/965>`_
28
84
  - refactors test_executor.py to enable Mac
29
85
 
30
86
 
@@ -35,13 +91,13 @@ Bugfixes
35
91
  --------
36
92
 
37
93
  - Fixed a long-standing bug, where calls to pg_ctl weren't getting `LC_*` and `LANG` envvars,
38
- which caused issues on some systems not recognizing --auth parameter. (`#343 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/343>`__)
94
+ which caused issues on some systems not recognizing --auth parameter. (`#343 <https://github.com/dbfixtures/pytest-postgresql/issues/343>`__)
39
95
 
40
96
 
41
97
  Miscellaneus
42
98
  ------------
43
99
 
44
- - `#945 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/945>`__
100
+ - `#945 <https://github.com/dbfixtures/pytest-postgresql/issues/945>`__
45
101
 
46
102
 
47
103
  6.0.0 (2024-03-11)
@@ -50,13 +106,13 @@ Miscellaneus
50
106
  Breaking changes
51
107
  ----------------
52
108
 
53
- - DatabaseJanitor class now accepts only keyword arguments. (`#899 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/899>`__)
109
+ - DatabaseJanitor class now accepts only keyword arguments. (`#899 <https://github.com/dbfixtures/pytest-postgresql/issues/899>`__)
54
110
 
55
111
 
56
112
  Bugfixes
57
113
  --------
58
114
 
59
- - Fix the remaining `DepcrecationWarning` for `datetime.datetime.utcnow` on Python 3.12. (`#896 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/896>`__)
115
+ - Fix the remaining `DepcrecationWarning` for `datetime.datetime.utcnow` on Python 3.12. (`#896 <https://github.com/dbfixtures/pytest-postgresql/issues/896>`__)
60
116
 
61
117
 
62
118
  Deprecations
@@ -65,7 +121,7 @@ Deprecations
65
121
  - Deprecated load parameter on a client fixture.
66
122
  Developers are encouraged to either use the load function/parameter
67
123
  for process fixture, or create an intermediate fixture placed between client
68
- and tests themselves to fill in the data. (`#850 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/850>`__)
124
+ and tests themselves to fill in the data. (`#850 <https://github.com/dbfixtures/pytest-postgresql/issues/850>`__)
69
125
 
70
126
 
71
127
  Features
@@ -73,18 +129,18 @@ Features
73
129
 
74
130
  - Now all sql files used to initialise database for tests, has to be passed as pathlib.Path instance.
75
131
 
76
- This helps the DatabaseJanitor choose correct behaviour based on parameter. (`#638 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/638>`__)
132
+ This helps the DatabaseJanitor choose correct behaviour based on parameter. (`#638 <https://github.com/dbfixtures/pytest-postgresql/issues/638>`__)
77
133
  - Have separate parameters for template database name and database name in DatabaseJanitor.
78
- It'll make it much clearer to understand the code and Janitor's behaviour. (`#672 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/672>`__)
134
+ It'll make it much clearer to understand the code and Janitor's behaviour. (`#672 <https://github.com/dbfixtures/pytest-postgresql/issues/672>`__)
79
135
  - Template databases are now created with is_template flag turned on, and not by setting allow_connections to false.
80
136
 
81
- The allow_connections flag being set to false is used strictly right before we attempt to drop the database. (`#914 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/914>`__)
137
+ The allow_connections flag being set to false is used strictly right before we attempt to drop the database. (`#914 <https://github.com/dbfixtures/pytest-postgresql/issues/914>`__)
82
138
 
83
139
 
84
140
  Miscellaneus
85
141
  ------------
86
142
 
87
- - `#865 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/865>`__, `#882 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/882>`__, `#893 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/893>`__, `#900 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/900>`__
143
+ - `#865 <https://github.com/dbfixtures/pytest-postgresql/issues/865>`__, `#882 <https://github.com/dbfixtures/pytest-postgresql/issues/882>`__, `#893 <https://github.com/dbfixtures/pytest-postgresql/issues/893>`__, `#900 <https://github.com/dbfixtures/pytest-postgresql/issues/900>`__
88
144
 
89
145
 
90
146
  5.1.1 (2024-03-07)
@@ -93,7 +149,7 @@ Miscellaneus
93
149
  Miscellaneus
94
150
  ------------
95
151
 
96
- - Add missing python 3.12 classifier to pythin package. (`#915 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/915>`__)
152
+ - Add missing python 3.12 classifier to pythin package. (`#915 <https://github.com/dbfixtures/pytest-postgresql/issues/915>`__)
97
153
 
98
154
 
99
155
  5.1.0 (2024-01-29)
@@ -102,26 +158,26 @@ Miscellaneus
102
158
  Bugfixes
103
159
  --------
104
160
 
105
- - Update postgresql_load default value for it to fallback into the empty list (`#881 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/881>`__)
161
+ - Update postgresql_load default value for it to fallback into the empty list (`#881 <https://github.com/dbfixtures/pytest-postgresql/issues/881>`__)
106
162
 
107
163
 
108
164
  Features
109
165
  --------
110
166
 
111
- - Support for Python 3.12 (`#835 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/835>`__)
167
+ - Support for Python 3.12 (`#835 <https://github.com/dbfixtures/pytest-postgresql/issues/835>`__)
112
168
 
113
169
 
114
170
  Miscellaneus
115
171
  ------------
116
172
 
117
- - Removed misleading parapgraph from one example in a README (`#688 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/688>`__)
118
- - Fixed typing exceptions for mypy 1.4 (`#765 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/765>`__)
119
- - README: fix section markup (`#771 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/771>`__, `#776 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/776>`__)
120
- - Add SQLAlchemy example for initialising common database state. (`#797 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/797>`__)
173
+ - Removed misleading parapgraph from one example in a README (`#688 <https://github.com/dbfixtures/pytest-postgresql/issues/688>`__)
174
+ - Fixed typing exceptions for mypy 1.4 (`#765 <https://github.com/dbfixtures/pytest-postgresql/issues/765>`__)
175
+ - README: fix section markup (`#771 <https://github.com/dbfixtures/pytest-postgresql/issues/771>`__, `#776 <https://github.com/dbfixtures/pytest-postgresql/issues/776>`__)
176
+ - Add SQLAlchemy example for initialising common database state. (`#797 <https://github.com/dbfixtures/pytest-postgresql/issues/797>`__)
121
177
  - Rely on cached/artifacted Pipfile.lock.
122
- That way, it will be specifically defined for given python version/system. (`#834 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/834>`__)
123
- - CI Change - Add PostgreSQL 16, drop PostgreSQL 11 (`#836 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/836>`__)
124
- - Replace usage of `pkg_resources.parse_version` with `packaging.version.parse` (`#858 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/858>`__)
178
+ That way, it will be specifically defined for given python version/system. (`#834 <https://github.com/dbfixtures/pytest-postgresql/issues/834>`__)
179
+ - CI Change - Add PostgreSQL 16, drop PostgreSQL 11 (`#836 <https://github.com/dbfixtures/pytest-postgresql/issues/836>`__)
180
+ - Replace usage of `pkg_resources.parse_version` with `packaging.version.parse` (`#858 <https://github.com/dbfixtures/pytest-postgresql/issues/858>`__)
125
181
 
126
182
 
127
183
  5.0.0 (2023-05-20)
@@ -130,7 +186,7 @@ Miscellaneus
130
186
  Breaking changes
131
187
  ----------------
132
188
 
133
- - Drop support for Python 3.7 (`#706 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/706>`__)
189
+ - Drop support for Python 3.7 (`#706 <https://github.com/dbfixtures/pytest-postgresql/issues/706>`__)
134
190
  - psycopg is now a mandatory requirement.
135
191
  With pyscop2 it was optional due to the different ways it could be installed:
136
192
 
@@ -138,32 +194,32 @@ Breaking changes
138
194
  * psycopg2-binary - binary distribution
139
195
  * psycopg2cffi - pypy enabled version
140
196
 
141
- Since psycopg version 3 there's only one package to install. (`#744 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/744>`__)
142
- - Dropped --postgresql-logsprefix/postgresql_logsprefix options. All fixture data is already distinguished by tmpdir itself. (`#748 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/748>`__)
197
+ Since psycopg version 3 there's only one package to install. (`#744 <https://github.com/dbfixtures/pytest-postgresql/issues/744>`__)
198
+ - Dropped --postgresql-logsprefix/postgresql_logsprefix options. All fixture data is already distinguished by tmpdir itself. (`#748 <https://github.com/dbfixtures/pytest-postgresql/issues/748>`__)
143
199
 
144
200
 
145
201
  Features
146
202
  --------
147
203
 
148
- - Re-rise FileNotFound errors with more meaningful messages. (`#598 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/598>`__)
149
- - Support Python 3.11 (`#678 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/678>`__)
204
+ - Re-rise FileNotFound errors with more meaningful messages. (`#598 <https://github.com/dbfixtures/pytest-postgresql/issues/598>`__)
205
+ - Support Python 3.11 (`#678 <https://github.com/dbfixtures/pytest-postgresql/issues/678>`__)
150
206
 
151
207
 
152
208
  Miscellaneus
153
209
  ------------
154
210
 
155
- - Drop PyPy from CI (`#669 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/669>`__)
156
- - pytest-postgresql will now recognise and use development postgresql versions (`#691 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/691>`__)
157
- - Use towncrier to maintain project's newsfragments/changelog (`#700 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/700>`__)
158
- - Move project dependency management to pipenv (`#701 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/701>`__)
159
- - Migrate to shared automerge workflow for automatic tests dependency updates (`#702 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/702>`__)
160
- - Use tbump instead of bumpversion to manage versioning and releases. (`#703 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/703>`__)
161
- - Move most of package configuration to pyproject.toml (`#704 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/704>`__)
162
- - Introduce Typed config dict (`#706 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/706>`__)
163
- - Use ankane/setup-postgres@v1 to setup postgresql in CI instead of custom scripts. (`#708 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/708>`__)
164
- - Pass codecov_token to codecov action to upload coverage. (`#721 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/721>`__)
165
- - Replaced flake8 and pydocstyle with ruff, turned on isort rules (`#735 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/735>`__)
166
- - Split single bid test job into smaller running each after another. (`#740 <https://github.com/ClearcodeHQ/pytest-postgresql/issues/740>`__)
211
+ - Drop PyPy from CI (`#669 <https://github.com/dbfixtures/pytest-postgresql/issues/669>`__)
212
+ - pytest-postgresql will now recognise and use development postgresql versions (`#691 <https://github.com/dbfixtures/pytest-postgresql/issues/691>`__)
213
+ - Use towncrier to maintain project's newsfragments/changelog (`#700 <https://github.com/dbfixtures/pytest-postgresql/issues/700>`__)
214
+ - Move project dependency management to pipenv (`#701 <https://github.com/dbfixtures/pytest-postgresql/issues/701>`__)
215
+ - Migrate to shared automerge workflow for automatic tests dependency updates (`#702 <https://github.com/dbfixtures/pytest-postgresql/issues/702>`__)
216
+ - Use tbump instead of bumpversion to manage versioning and releases. (`#703 <https://github.com/dbfixtures/pytest-postgresql/issues/703>`__)
217
+ - Move most of package configuration to pyproject.toml (`#704 <https://github.com/dbfixtures/pytest-postgresql/issues/704>`__)
218
+ - Introduce Typed config dict (`#706 <https://github.com/dbfixtures/pytest-postgresql/issues/706>`__)
219
+ - Use ankane/setup-postgres@v1 to setup postgresql in CI instead of custom scripts. (`#708 <https://github.com/dbfixtures/pytest-postgresql/issues/708>`__)
220
+ - Pass codecov_token to codecov action to upload coverage. (`#721 <https://github.com/dbfixtures/pytest-postgresql/issues/721>`__)
221
+ - Replaced flake8 and pydocstyle with ruff, turned on isort rules (`#735 <https://github.com/dbfixtures/pytest-postgresql/issues/735>`__)
222
+ - Split single bid test job into smaller running each after another. (`#740 <https://github.com/dbfixtures/pytest-postgresql/issues/740>`__)
167
223
 
168
224
 
169
225
  4.1.1
@@ -174,7 +230,7 @@ Misc
174
230
 
175
231
  - Error message typo fix
176
232
  - Docker documentation example typo fixes
177
- - Have setuptools required as package dependency. pkg_resources.parse_version is used in code
233
+ - Have setuptools required as package dependency. pkg_resources.parse_version is used in code
178
234
  but setuptools was only used as build requirements
179
235
 
180
236
  4.1.0
@@ -314,7 +370,7 @@ Bugfix
314
370
  2.6.0
315
371
  =====
316
372
 
317
- - [enhancement] add ability to pass options to pg_ctl's -o flag to send arguments to the underlying postgres executable
373
+ - [enhancement] add ability to pass options to pg_ctl's -o flag to send arguments to the underlying postgres executable
318
374
  Use `postgres_options` as fixture argument, `--postgresql-postgres-options` as pytest starting option or
319
375
  `postgresql_postgres_options` as pytest.ini configuration option
320
376
 
@@ -364,7 +420,7 @@ Bugfix
364
420
  =====
365
421
 
366
422
  - [feature] Allow to set password for postgresql. Use it throughout the flow.
367
- - [bugfix] Default Janitor's connections to postgres database. When using custom users,
423
+ - [bugfix] Default Janitor's connections to postgres database. When using custom users,
368
424
  postgres attempts to use user's database and it might not exist.
369
425
  - [bugfix] NoopExecutor connects to read version by context manager to properly handle cases
370
426
  where it can't connect to the server.
@@ -399,7 +455,7 @@ Bugfix
399
455
  1.4.1
400
456
  =====
401
457
 
402
- - [bugfix] Allow creating test database with hyphens
458
+ - [bugfix] Allow creating test database with hyphens
403
459
 
404
460
  1.4.0
405
461
  =====
@@ -19,7 +19,13 @@ Feature requests/proposals
19
19
  #. Provide as detailed description as possible
20
20
  * Use case is great to have
21
21
  #. There'll be a bit of discussion for the feature. Don't worry, if it is to be accepted, we'd like to support it, so we need to understand it thoroughly.
22
-
22
+
23
+ Development
24
+ -----------
25
+
26
+ #. Fork the repository
27
+ #. Clone the repository
28
+ #. Create a virtual environment with ``pipenv install --dev``
23
29
 
24
30
  Pull requests
25
31
  -------------
@@ -40,13 +46,17 @@ Commits
40
46
  Coding style
41
47
  ------------
42
48
 
43
- #. Coding style is being handled by black and doublechecked by flake8 and pydocstyle
49
+ #. Coding style is being handled by black and doublechecked by ruff.
44
50
  * We provide a `pre-commit <https://pre-commit.com/>`_ configuration for invoking these on commit.
45
51
 
46
52
  Testing
47
53
  -------
48
54
 
49
- # Tests are written using pytest.
50
- # PR tests run on Github Actions.
51
- # In order to run the tests locally you need to have one version of postgres installed. And pass envvar named `POSTGRES` with used version number
52
- # If you encounter any test failures due to locale issues, make sure that both `en_US.UTF-8` and `de_DE.UTF-8` are enabled in `/etc/locale.gen` and then run `sudo locale-gen`.
55
+ #. Tests are written using `pytest <https://docs.pytest.org/>`_
56
+ #. PR tests run on Github Actions.
57
+ #. Run a PostgreSQL server [#]_, and create a default super user ``createuser --superuser postgres``
58
+ #. Set envvar named ``POSTGRES`` with used version number
59
+ #. Run tests with ``pipenv run pytest``
60
+ #. If you encounter any test failures due to locale issues, make sure that both ``en_US.UTF-8`` and ``de_DE.UTF-8`` are enabled in ``/etc/locale.gen`` and then run ``sudo locale-gen``.
61
+
62
+ .. [#] Installing and configuring a PostgreSQL server is out of scope of this document. Please refer to `PostgreSQL documentation <https://www.postgresql.org/docs/>`_ for more information.
@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
671
671
  may consider it more useful to permit linking proprietary applications with
672
672
  the library. If this is what you want to do, use the GNU Lesser General
673
673
  Public License instead of this License. But first, please read
674
- <http://www.gnu.org/philosophy/why-not-lgpl.html>.
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
@@ -162,4 +162,4 @@ General Public License ever published by the Free Software Foundation.
162
162
  whether future versions of the GNU Lesser General Public License shall
163
163
  apply, that proxy's public statement of acceptance of any version is
164
164
  permanent authorization for you to choose that version for the
165
- Library.
165
+ Library.
@@ -1,11 +1,11 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: pytest-postgresql
3
- Version: 6.1.1
3
+ Version: 7.0.0
4
4
  Summary: Postgresql fixtures and fixture factories for Pytest.
5
5
  Author-email: Grzegorz Śliwiński <fizyk+pypi@fizyk.dev>
6
- Project-URL: Source, https://github.com/ClearcodeHQ/pytest-postgresql
7
- Project-URL: Bug Tracker, https://github.com/ClearcodeHQ/pytest-postgresql/issues
8
- Project-URL: Changelog, https://github.com/ClearcodeHQ/pytest-postgresql/blob/v6.1.1/CHANGES.rst
6
+ Project-URL: Source, https://github.com/dbfixtures/pytest-postgresql
7
+ Project-URL: Bug Tracker, https://github.com/dbfixtures/pytest-postgresql/issues
8
+ Project-URL: Changelog, https://github.com/dbfixtures/pytest-postgresql/blob/v7.0.0/CHANGES.rst
9
9
  Keywords: tests,pytest,fixture,postgresql
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Environment :: Web Environment
@@ -15,30 +15,30 @@ Classifier: Natural Language :: English
15
15
  Classifier: Operating System :: OS Independent
16
16
  Classifier: Programming Language :: Python
17
17
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
21
20
  Classifier: Programming Language :: Python :: 3.11
22
21
  Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
23
  Classifier: Programming Language :: Python :: 3 :: Only
24
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
25
  Classifier: Topic :: Software Development :: Testing
26
26
  Classifier: Framework :: Pytest
27
- Requires-Python: >=3.8
27
+ Requires-Python: >=3.9
28
28
  Description-Content-Type: text/x-rst
29
29
  License-File: COPYING
30
30
  License-File: COPYING.lesser
31
31
  License-File: AUTHORS.rst
32
32
  Requires-Dist: pytest>=6.2
33
33
  Requires-Dist: port-for>=0.7.3
34
- Requires-Dist: mirakuru
35
- Requires-Dist: setuptools
34
+ Requires-Dist: mirakuru>=2.6.0
35
+ Requires-Dist: packaging
36
36
  Requires-Dist: psycopg>=3.0.0
37
37
 
38
- .. image:: https://raw.githubusercontent.com/ClearcodeHQ/pytest-postgresql/master/logo.png
38
+ .. image:: https://raw.githubusercontent.com/dbfixtures/pytest-postgresql/master/logo.png
39
39
  :width: 100px
40
40
  :height: 100px
41
-
41
+
42
42
  pytest-postgresql
43
43
  =================
44
44
 
@@ -122,38 +122,25 @@ Sample test
122
122
  postgresql.commit()
123
123
  cur.close()
124
124
 
125
- If you want the database fixture to be automatically populated with your schema there are two ways:
125
+ Pre-populating the database for tests
126
+ -------------------------------------
126
127
 
127
- #. client fixture specific
128
- #. process fixture specific
128
+ If you want the database fixture to be automatically pre-populated with your schema and data, there are two lewels you can achieve it:
129
129
 
130
- Both are accepting same set of possible loaders:
130
+ #. per test in a client fixture, by an intermediary fixture between client and your test (or other fixtures)
131
+ #. per session in a process fixture
131
132
 
132
- * sql file path
133
- * loading function import path (string)
134
- * actual loading function
133
+ The process fixture accepts a load parameter, which accepts these loaders:
135
134
 
136
- That function will receive **host**, **port**, **user**, **dbname** and **password** kwargs and will have to perform
137
- connection to the database inside. However, you'll be able to run SQL files or even trigger programmatically database
138
- migrations you have.
135
+ * sql file path - which will load and execute sql files
136
+ * loading functions - either by string import path, actual callable.
137
+ Loading functions will receive **host**, **port**, **user**, **dbname** and **password** arguments and will have to perform
138
+ connection to the database inside. Or start session in the ORM of your choice to perform actions with given ORM.
139
+ This way, you'd be able to trigger ORM based data manipulations, or even trigger database migrations programmatically.
139
140
 
140
- Client specific loads the database each test
141
-
142
- .. code-block:: python
143
-
144
- from pathlib import Path
145
- postgresql_my_with_schema = factories.postgresql(
146
- 'postgresql_my_proc',
147
- load=[Path("schemafile.sql"), Path("otherschema.sql"), "import.path.to.function", "import.path.to:otherfunction", load_this]
148
- )
149
-
150
- .. warning::
151
-
152
- This way, the database will still be dropped each time.
153
-
154
-
155
- The process fixture performs the load once per test session, and loads the data into the template database.
156
- Client fixture then creates test database out of the template database each test, which significantly **speeds up the tests**.
141
+ The process fixture pre-populates the database once per test session (at the start of the process fixture),
142
+ and loads the schema and data into the template database. Client fixture then creates test database out of the template database each test,
143
+ which significantly **speeds up the tests**.
157
144
 
158
145
  .. code-block:: python
159
146
 
@@ -162,14 +149,15 @@ Client fixture then creates test database out of the template database each test
162
149
  load=[Path("schemafile.sql"), Path("otherschema.sql"), "import.path.to.function", "import.path.to:otherfunction", load_this]
163
150
  )
164
151
 
152
+ Additional benefit, is that test code might safely use separate database connection, and can safely test it's behaviour with transactions and rollbacks,
153
+ as tests and code will work on separate database connections.
154
+
155
+ Defining pre-populate on command line:
165
156
 
166
157
  .. code-block:: sh
167
158
 
168
159
  pytest --postgresql-populate-template=path.to.loading_function --postgresql-populate-template=path.to.other:loading_function --postgresql-populate-template=path/to/file.sql
169
160
 
170
-
171
- The loading_function from example will receive , and have to commit that.
172
-
173
161
  Connecting to already existing postgresql database
174
162
  --------------------------------------------------
175
163
 
@@ -222,6 +210,12 @@ You can pick which you prefer, but remember that these settings are handled in t
222
210
  - postgresql_port
223
211
  - yes (5432)
224
212
  - random
213
+ * - Port search count
214
+ -
215
+ - --postgresql-port-search-count
216
+ - postgresql_port_search_count
217
+ - -
218
+ - 5
225
219
  * - postgresql user
226
220
  - user
227
221
  - --postgresql-user
@@ -270,6 +264,18 @@ You can pick which you prefer, but remember that these settings are handled in t
270
264
  - postgresql_options
271
265
  - yes
272
266
  -
267
+ * - Drop test database on start.
268
+
269
+ .. warning::
270
+
271
+ Use carefully as it might lead to unexpected results within your test suite.
272
+ -
273
+ - --postgresql-drop-test-database
274
+ -
275
+ - false
276
+ -
277
+
278
+
273
279
 
274
280
 
275
281
  Example usage:
@@ -385,11 +391,11 @@ For this import DatabaseJanitor and use its init and drop methods:
385
391
  # variable definition
386
392
 
387
393
  janitor = DatabaseJanitor(
388
- postgresql_proc.user,
389
- postgresql_proc.host,
390
- postgresql_proc.port,
391
- "my_test_database",
392
- postgresql_proc.version,
394
+ user=postgresql_proc.user,
395
+ host=postgresql_proc.host,
396
+ proc=postgresql_proc.port,
397
+ testdb="my_test_database",
398
+ version=postgresql_proc.version,
393
399
  password="secret_password",
394
400
  )
395
401
  janitor.init()
@@ -414,11 +420,11 @@ or use it as a context manager:
414
420
  # variable definition
415
421
 
416
422
  with DatabaseJanitor(
417
- postgresql_proc.user,
418
- postgresql_proc.host,
419
- postgresql_proc.port,
420
- "my_test_database",
421
- postgresql_proc.version,
423
+ user=postgresql_proc.user,
424
+ host=postgresql_proc.host,
425
+ port=postgresql_proc.port,
426
+ dbname="my_test_database",
427
+ version=postgresql_proc.version,
422
428
  password="secret_password",
423
429
  ):
424
430
  yield psycopg2.connect(